UUID\_PARSE(3) Programmers Manual UUID\_PARSE(3)

# [NAME](#NAME)

uuid\_parse - convert an input UUID string into binary representation

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;uuid.h&gt;**

**int uuid\_parse(const char \*in, uuid\_t uu);**  
**int uuid\_parse\_range(const char \*in\_start, const char \*in\_end, uuid\_t uu);**

# [DESCRIPTION](#DESCRIPTION)

The **uuid\_parse**() function converts the UUID string given by *in* into the binary representation. The input UUID is a string of the form 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb (in [**printf**(3)](/man/os/util-linux/printf.3) format "%08x-%04x-%04x-%04x-%012x", 36 bytes plus the trailing '\\0').

The [**uuid\_parse\_range**(3)](/man/os/util-linux/uuid_parse_range.3) function works like **uuid\_parse**() but parses only range in string specified by *in\_start* and *in\_end* pointers.

# [RETURN VALUE](#RETURN_VALUE)

Upon successfully parsing the input string, 0 is returned, and the UUID is stored in the location pointed to by *uu*, otherwise -1 is returned.

# [CONFORMING TO](#CONFORMING_TO)

This library parses UUIDs compatible with OSF DCE 1.1, and hash based UUIDs V3 and V5 compatible with *RFC-4122* &lt;https://tools.ietf.org/html/rfc4122&gt;.

# [AUTHORS](#AUTHORS)

Theodore Y. Ts’o

# [SEE ALSO](#SEE_ALSO)

[**uuid**(3)](/man/os/util-linux/uuid.3), [**uuid\_clear**(3)](/man/os/util-linux/uuid_clear.3), [**uuid\_compare**(3)](/man/os/util-linux/uuid_compare.3), [**uuid\_copy**(3)](/man/os/util-linux/uuid_copy.3), [**uuid\_generate**(3)](/man/os/util-linux/uuid_generate.3), [**uuid\_is\_null**(3)](/man/os/util-linux/uuid_is_null.3), [**uuid\_time**(3)](/man/os/util-linux/uuid_time.3), [**uuid\_unparse**(3)](/man/os/util-linux/uuid_unparse.3)

# [REPORTING BUGS](#REPORTING_BUGS)

For bug reports, use the *issue tracker* &lt;https://github.com/util-linux/util-linux/issues&gt;.

# [AVAILABILITY](#AVAILABILITY)

The **libuuid** library is part of the util-linux package since version 2.15.1. It can be downloaded from *Linux Kernel Archive* &lt;https://www.kernel.org/pub/linux/utils/util-linux/&gt;.

2026-09-25 util-linux 2.42.4

---

Document: uuid_parse(3) from util-linux 2.42.4-r0 (Chainguard OS)
