UUID Generator & Decoder

Generate UUID v4 and v7, bulk generate, decode versions, and extract timestamps

Use this free UUID generator to create universally unique identifiers instantly. Generate UUID v4 (random) or UUID v7 (timestamp-based) with one click. Bulk generate up to 100 UUIDs, decode any UUID version, and validate format. 100% client-side, your data never leaves your browser.

Click Generate to create a UUID

UUID Version Comparison

UUID Versions

v1Timestamp + MAC address
v3MD5 hash of namespace + name
v4Random (most widely used)
v5SHA-1 hash of namespace + name
v7Timestamp + random (new standard)

UUID v4 vs v7

Sortablev4: No, v7: Yes (time-ordered)
DB perfv4: Poor (random), v7: Great
Timestampv4: None, v7: Millisecond
Randomnessv4: 122 bits, v7: 74 bits
Best forv4: General, v7: Primary keys

UUID Guide

What is a UUID?

UUID (Universally Unique Identifier) is a 128-bit identifier standardized in RFC 9562. UUIDs are formatted as 32 hexadecimal digits in 5 groups separated by hyphens: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M is the version and N indicates the variant.

UUIDs are used everywhere: database primary keys, API resource identifiers, session tokens, file names, and distributed system IDs. They can be generated independently on any machine without coordination.

UUID v4: Random

UUID v4 is the most widely used version. It fills 122 of the 128 bits with cryptographically secure random data (6 bits are reserved for version and variant). The probability of generating two identical v4 UUIDs is astronomically low: you would need to generate about 2.71 quintillion UUIDs for a 50% collision chance.

UUID v4 is suitable for most use cases but has one drawback: random values cause fragmentation in B-tree database indexes. For database primary keys, consider UUID v7 instead.

UUID v7: Timestamp-Based

UUID v7 is the newest version, combining a 48-bit Unix timestamp (millisecond precision) with random bits. This makes UUIDs both unique and chronologically sortable. Because new IDs are always greater than previous ones, they perform well as database primary keys without causing B-tree page splits.

UUID v7 is the recommended choice for new applications that need unique identifiers with natural time ordering. For more on time-sortable distributed IDs, see our post on How Snowflake IDs Work.

UUID vs Snowflake ID

  • Size: UUID is 128 bits (36 characters with hyphens). Snowflake ID is 64 bits (up to 19 digits).
  • Sortability: UUID v7 and Snowflake IDs are both time-sortable. UUID v4 is not.
  • Database performance: Snowflake IDs are more compact and efficient as primary keys. UUID v7 is a good middle ground.
  • Adoption: UUIDs are universally supported. Snowflake IDs require custom generation logic.

Use our Snowflake ID Decoder to decode Discord, Twitter, and Instagram IDs.

UUID Generator FAQ

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier that is unique across space and time. It is displayed as 32 hex characters in 5 groups: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. UUIDs are used as database primary keys, API identifiers, and distributed system IDs.

What is the difference between UUID v4 and UUID v7?

UUID v4 uses 122 random bits, making each UUID unique but not time-sortable. UUID v7 combines a 48-bit timestamp with random bits, making UUIDs both unique and chronologically sortable. UUID v7 is better for database primary keys because sequential IDs improve index performance.

Is a UUID the same as a GUID?

Yes. GUID (Globally Unique Identifier) is Microsoft's term for UUID. They are the same 128-bit format. UUID is the standard term from RFC 9562. GUID is primarily used in .NET, SQL Server, and Windows APIs.

Can two UUIDs ever be the same?

Theoretically yes, but practically no. UUID v4 has 5.3 x 1036 possible values. You would need to generate about 2.71 quintillion UUIDs for a 50% collision chance. UUID collisions do not happen in practice.

Which UUID version should I use?

Use UUID v4 for general-purpose unique identifiers. Use UUID v7 for database primary keys, event IDs, or any case where time-ordering improves performance. UUID v7 is the recommended choice for new applications.

Why are random UUIDs bad for databases?

Random UUIDs (v4) cause poor B-tree index performance because new IDs insert at random positions, causing page splits and fragmentation. UUID v7 solves this with timestamp-prefixed IDs that are naturally sequential. See our Snowflake ID guide for more on this topic.

How do I extract a timestamp from a UUID?

UUID v1 and v7 contain embedded timestamps. Paste any UUID into the decoder above and it will automatically detect the version and extract the timestamp. For UUID v7, the first 48 bits encode Unix milliseconds.

Is it safe to generate UUIDs online?

Yes. This tool uses crypto.getRandomValues() for cryptographically secure random number generation. All UUIDs are generated entirely in your browser. No data is sent to any server.