How to Generate a UUID (v4, v7) or ULID
Updated 2026-06-21
A UUID (universally unique identifier, also called a GUID) is a 128-bit value written as 36 characters — five hyphen-separated groups like 8 chars, 4, 4, 4, then 12. The fastest way to make one is a generator: pick a version, set how many you want, and copy the result. Below is what each format means and when to reach for it.
UUID v4, UUID v7, or ULID — which one?
All three are practically collision-proof, but they differ in how they're built:
- UUID v4 is fully random. It's the default, universally supported choice for things like API keys, session tokens, and any identifier where you don't care about ordering. The trade-off: because the values are random, they scatter when used as a database primary key, which can hurt index performance.
- UUID v7 embeds a millisecond timestamp at the front, so IDs sort roughly in creation order. That makes them far friendlier as database keys — new rows append to the end of the index instead of inserting randomly — while staying a standard 36-character UUID.
- ULID is a 26-character, time-sortable identifier using Crockford base32 (no hyphens, no ambiguous letters like I, L, O or U). It's shorter than a UUID, URL-safe, and lexicographically sortable by creation time — popular when you want compact, ordered IDs that read cleanly in a URL.
If you're unsure, v4 is the safe general-purpose pick. Choose v7 or ULID when you specifically want time-ordered IDs.
How to generate one (or thousands)
- Open the UUID & ULID Generator.
- Choose the format: UUID v4, UUID v7, or ULID.
- Set the count — generate a single ID, or a bulk batch for seeding a database or test fixtures.
- Copy one value, or copy the whole list at once to paste into your code, spreadsheet, or migration script.
A worked example: to seed a test table with 500 ordered rows, pick UUID v7, set the count to 500, and copy the batch. Because v7 sorts by time, the inserted rows land in index order automatically.
Why crypto randomness matters
The random part of every ID here comes from the browser's cryptographic random source, not a basic pseudo-random function. That matters when an ID doubles as something hard to guess — a password-reset token or an unguessable share link. Weak randomness can make IDs predictable; crypto randomness keeps the odds of a collision or a guess astronomically low.
A note on privacy
Identifiers often end up tied to real records, so it's worth knowing where they're minted. This generator runs entirely in your browser tab — nothing is sent to a server, there's no signup, and no log of what you generated. That's a real difference from web generators that mint IDs server-side, where your values pass through someone else's machine.
Need an ID right now? Pick your format and generate in one click with the UUID & ULID Generator.