All Articles
Developer

UUID v4: When a Random Identifier Is Useful

December 1, 20263 min read

UUID Generator with UUID v4 selected showing a generated lowercase hyphenated ID, with Generate, Download and Clear buttons and an About UUID v4 panel

A UUID v4 is a 128-bit identifier made mostly of random bits, written as 36 characters like 550e8400-e29b-41d4-a716-446655440000. It is useful when several systems, such as an app, a server and an import script, must create record IDs on their own without checking a central counter. It is an identifier, not a secret: never treat one as a password or access token.

Generate one and read it

  1. Open the UUID Generator. UUID v4 is selected under ID Type and one ID is already generated for you.
  2. Click the blue Generate button for a fresh one, then Copy to put it on your clipboard. Your value will differ from the screenshot, because it is random each time.
  3. Check the shape: five groups of 8-4-4-4-12 hexadecimal characters. In a v4 UUID the first character of the third group is always 4 (the version), and the first character of the fourth group is 8, 9, a or b (the variant). In the example above, 1b9c1b78-c933-47f2-ad2c-... follows that pattern.
UUID Generator with Case Format set to Uppercase and Include hyphens unchecked, showing a 32-character uppercase UUID without hyphens

Match the format your system wants

  1. Under Format Options, set Case Format to Uppercase and untick Include hyphens. The ID becomes 32 characters with no hyphens, as in the second screenshot. This changes only how the same 128 bits are written.
  2. Use Prefix or Suffix only if your system expects one. They are added to the text, so the result is no longer a plain UUID.

Some databases store a UUID as 16 binary bytes, and others store it as text, so follow your database or API specification. Many systems accept either letter case but print lowercase; if yours compares strings, pick one case and keep it.

Advertisement

What a UUID is not

  • Not a password or token. Anyone who sees an ID in a URL can use it. If an ID grants access, protect the record with real authorization, and generate secrets with a purpose-built secure token mechanism.
  • Not guaranteed unique. Collisions are astronomically unlikely with 122 random bits, but you should still keep a uniqueness constraint in the database. And never paste one sample UUID into many records.
  • Not sorted. v4 IDs have no time order, so they scatter across an index; if you need sortable IDs, the tool also offers ULID and other types.

If it doesn't work

  • If the system rejects your ID, compare its length: 36 characters with hyphens, 32 without.
  • If every click gives the same ID, make sure you are using Generate and not Copy, and that the type is UUID v4.
  • If the list is empty after Clear, click Generate again.
Advertisement
UUIDDeveloper ToolsIDs