UUID to Binary / Base64 Converter

    Convert a UUID into binary, base64, URL-safe base64, a byte array, a 128-bit integer, and URN form.

    Convert a UUID

    Accepts hyphenated UUIDs, 32 hexadecimal digits, braces and urn:uuid: prefixes. Uppercase and lowercase are accepted. Conversion stays in your browser. Uses canonical UUID byte order. MySQL swap mode and Microsoft GUID mixed-endian bytes are different formats.

    UUID to binary and Base64: worked example

    These are different representations of the same 16 bytes. The example is available without entering a value.

    UUID
    919108f7-52d1-4320-9bac-f847db4148a8
    Hexadecimal (32 characters)
    919108f752d143209bacf847db4148a8
    Binary (128 bits, grouped into bytes)
    10010001 10010001 00001000 11110111 01010010 11010001 01000011 00100000 10011011 10101100 11111000 01000111 11011011 01000001 01001000 10101000
    Base64 (24 characters, including padding)
    kZEI91LRQyCbrPhH20FIqA==
    Base64 URL-safe (22 characters, no padding)
    kZEI91LRQyCbrPhH20FIqA

    Base64 encodes the 16 UUID bytes, not the 36 characters of the UUID string. Encoding that text produces a different result.

    Store the bytes in MySQL BINARY(16)

    Use swap flag 0 to match this converter’s byte order. This read-only example shows the hex bytes and converts them back to a UUID:

    SELECT HEX(UUID_TO_BIN('919108f7-52d1-4320-9bac-f847db4148a8', 0));
    -- 919108F752D143209BACF847DB4148A8
    SELECT BIN_TO_UUID(UNHEX('919108f752d143209bacf847db4148a8'), 0);
    -- 919108f7-52d1-4320-9bac-f847db4148a8

    MySQL swap flag 1 rearranges time fields for version 1 UUIDs; it is not this converter’s output. Use matching flags when converting back. Microsoft GUID mixed-endian byte arrays also differ from canonical UUID byte order.

    References: UUID format and byte order (RFC 9562) and MySQL UUID_TO_BIN documentation.

    A UUID is really just a 128-bit number, and the familiar 36-character string is only one way to write it. This converter turns any UUID into the representations developers actually need for storage, transport, and URLs — right in your browser.

    Paste a UUID above to get its binary, hexadecimal, base64, URL-safe base64, byte-array, integer, and URN forms, each with a one-click copy button.

    Why convert a UUID?

    A UUID contains 16 bytes (128 bits). Its hyphenated text form has 36 characters; actual text storage depends on encoding and database overhead. Native UUID or binary storage avoids that text representation. The displayed bits and comma-separated decimal bytes are readable text, not a binary database value.

    Base64 and URL-safe base64 are handy when you need a shorter, transport-friendly encoding — for example, embedding an identifier in a URL, cookie, or JSON payload without hyphens.

    The formats explained

    Hexadecimal removes the hyphens to give the compact 32-character form. Binary expands the 16 bytes into 128 bits. The byte array lists each of the 16 bytes in decimal, which is useful when constructing a UUID in code.

    The 128-bit integer is the UUID interpreted as a single base-10 number, and the URN form (urn:uuid:…) is the IETF-registered URI representation. URL-safe base64 swaps + and / for - and _ and drops padding so the value is safe to drop straight into a URL.

    Frequently asked questions

    How do I convert a UUID to binary?
    Paste the UUID above to display its 128 bits, grouped into 16 bytes. To store it in MySQL BINARY(16), use UUID_TO_BIN(uuid, 0) or decode the hexadecimal output into bytes. Do not insert the displayed bit string or comma-separated decimal text directly into the column.
    How do I convert a UUID to base64?
    The converter encodes the UUID’s 16 bytes as base64 and as URL-safe base64 (using - and _ with no padding) so you can copy whichever your system needs.
    Should I store UUIDs as binary or text?
    A UUID has a 16-byte payload. Use a native UUID type where supported, or a suitable binary type such as MySQL BINARY(16). Text storage and index performance depend on encoding, the database and workload.