Skip to content

UUID generator

Generate random v4 or time-ordered v7 UUIDs, one or in bulk.

Updated

Version

Version 4 UUIDs are 122 random bits: collisions are practically impossible.

How to generate UUIDs

  1. Pick version 4 for fully random IDs or version 7 for time-ordered ones.
  2. Choose how many you need, up to 1,000 at a time.
  3. Set uppercase or drop the hyphens if your system expects it.
  4. Copy them or download a text file with one UUID per line.

UUID v4 vs v7

Version 4Version 7
Made from122 random bits48-bit millisecond timestamp + 74 random bits
Sort orderRandomOrder of creation
Database indexesScattered insertsAppend-friendly, faster inserts
Reveals creation timeNoYes, to the millisecond

Reading a UUID

A UUID is 128 bits written as 32 hexadecimal digits in five groups: 8-4-4-4-12. The first digit of the third group is the version (4 or 7), and the first digit of the fourth group is8, 9, a or b, marking the standard variant.

Common uses

  • Seeding a test database. Generate up to 1,000 IDs at once and download them as a text file to fill test data, fixtures or a sample import.
  • Unique IDs for spreadsheet rows. Give each row of a spreadsheet or CSV import a stable unique ID by pasting a column of UUIDs next to your data.
  • A one-off ID while testing. Need an ID for a test request, a config entry or an idempotency key? Generate one and copy it with a click.

Questions

Should I use UUID v4 or v7?

Use v7 for database keys: it starts with a timestamp, so new IDs sort after old ones and indexes stay efficient. Use v4 when the ID shouldn't reveal when it was created.

Can two UUIDs ever be the same?

In theory, but not in practice. A v4 UUID has 122 random bits; you would need to generate about a billion per second for 85 years to have a 50% chance of a single collision.

What's the difference between a UUID and a GUID?

Nothing meaningful. GUID is Microsoft's name for the same 128-bit identifier. GUIDs are often written in uppercase, which the Uppercase option covers.

Which standard do these follow?

RFC 9562, which defines both versions. Each UUID carries its version number and the standard variant bits, so any UUID library can read them.

All generators →