What Is a UUID, and How Do You Generate One?

2026-08-02

A UUID is a 128-bit identifier designed so that anyone can generate one, anywhere, without asking permission, and still be confident it will never collide with anyone else's. Version 4 achieves this the simple way: 122 of those bits are random.

Step by step

  1. Open the UUID Generator.
  2. Choose how many you need — 1, 5, 10, 50 or 100.
  3. Set the format: hyphens, case, braces.
  4. Copy them, or download them as a text file.

Why not just use an auto-incrementing integer?

Because an integer requires coordination. Something has to hand out the next number, which means:

  • You cannot generate an ID before the row is inserted.
  • You cannot merge two databases without renumbering everything.
  • You cannot generate IDs on a client that is currently offline.
  • Your IDs leak information — /orders/1042 tells a competitor roughly how many orders you have taken.

A UUID solves all four, at the cost of being longer and not sorting chronologically.

Could two UUIDs ever collide?

In theory yes, in practice no. With 122 random bits you would need to generate billions of UUIDs per second for about a century before a collision became likely. For comparison, you are considerably more likely to be struck by a meteorite.

A UUID is an identifier, not a secret

This is worth being clear about. Version 4 UUIDs generated from a cryptographic random source are unguessable, which tempts people into using them as access tokens in URLs. Don't. URLs end up in browser history, server logs, referrer headers and analytics. Use a real token with an expiry.

Formatting options

Lowercase with hyphens is the RFC form and the right default. Uppercase is common in older enterprise tooling, braces match the Microsoft registry convention, and removing the hyphens gives you the compact 32-character hex string some databases prefer.

Generate UUIDs now →