UUID Generator

Generate v4 / v7 UUIDs (GUIDs) with one click.

Open tool

Overview

Generate v4 (random) or v7 (time-ordered) UUIDs - also known as GUIDs - with one click. Optional bulk mode produces a list of N values for seeding test data, and the output format is the standard 36-character hex-with-hyphens representation that fits every database and language SDK.

It's for developers needing unique identifiers for database keys, API request IDs, idempotency keys, or test fixtures. Reach for it when bootstrapping a record without a backend round-trip, when scaffolding migration data, or when comparing v4's randomness with v7's time-sortability.

How it works

UUID v4 (RFC 4122) is 122 bits of cryptographically random data with 6 bits set to fixed values to indicate the version and variant. Collisions are statistically impossible at any reasonable scale.

UUID v7 (RFC 9562, 2024) replaces the high bits with a 48-bit Unix millisecond timestamp, leaving the low bits random. The benefit: UUIDs generated near each other in time sort near each other in lexical order - useful for database insertion order, time-bucket indexing, and pagination.

Examples

  • v4 sample:
    9b6b85c5-2f9e-4a1c-8f0a-2e8e6d4f7c0c
    
  • v7 sample (note the timestamp prefix):
    018f6c5a-7e90-7abc-9123-456789abcdef
    ^^^^^^^^^^^^^ -- 48-bit ms timestamp
    
  • Bulk generation (5 values):
    9b6b85c5-...
    3e8d0f12-...
    ... (5 distinct UUIDs)
    
  • Use in a SQL insert:
    INSERT INTO posts (id, title) VALUES ('018f6c5a-...', 'Hello');
    

FAQ

Should I use v4 or v7?

v7 for database primary keys - it's still globally unique and indexes much better than random v4 because new rows insert at the end of the index. v4 for everything else where you don't want sortable IDs (idempotency keys, session tokens).

Is the version visible in the UUID itself?

Yes - the 13th hex digit indicates the version: 4xxx for v4, 7xxx for v7. The 17th digit's first hex character encodes the variant.

How many UUIDs can I safely generate?

For v4, you'd need to generate billions before any collision becomes mathematically plausible. For practical purposes, treat them as unique forever.

Are these the same as Microsoft GUIDs?

Yes - GUID is Microsoft's name for UUID. The on-the-wire format is identical; some Microsoft APIs use a different byte order in binary form.

Try UUID Generator

An unhandled error has occurred. Reload ×