piapia123
en

UUID, ULID, NanoID and ObjectId Generator

Generators

Everything runs locally in your browser — nothing is uploaded

Output

Produce a whole column of identifiers at once, one per line, ready to paste into a spreadsheet or a fixture script. Each type solves a different problem: v4 is 122 random bits, right for an unguessable reference; v7 leads with a 48-bit millisecond timestamp, so sorting the strings sorts them by creation time and new rows land at the end of a database index instead of scattering B-tree pages the way v4 does; ULID is also time-ordered but encoded in Crockford Base32, so 26 characters are enough; NanoID is shorter still, 21 URL-safe characters, which makes it a good fit for links; ObjectId is MongoDB’s key format, twelve hex bytes whose first four are seconds rather than milliseconds, so its resolution stops at the second. ⚠️ The v8 payload is defined by the application; what this tool writes is the common timestamp-plus-random layout, which only means something if your system agreed on the same one — without such an agreement, use v7.

Features

  • Eight flavours: UUID v4 (random), v7 (time-ordered), v8 (custom payload), ULID, NanoID, CUID, short ID and MongoDB ObjectId
  • Generate 1 to 1000 values at a time, one per line for easy column copying
  • UUID v4 writes the version and variant bits exactly as RFC 4122 requires, so any validator accepts it
  • UUID v7 and ULID share one millisecond timestamp per batch with an incrementing counter, so sorting the batch equals generation order
  • ULID uses Crockford Base32, which leaves out the easily confused I, L, O and U
  • ObjectId follows the BSON layout — four bytes of seconds, five bytes of per-process randomness, three bytes of counter — with a random counter start that cannot wrap mid-batch
  • Switch to uppercase hex, or drop the hyphens entirely

How to use

  1. Pick the type: v4, v7, ULID, NanoID or ObjectId
  2. Set the count, up to 1000
  3. Tick uppercase or hyphens if you need them
  4. Leave the input box empty and click Run
  5. Click Copy to take the whole column

FAQ

Can I use a UUID as a password or an API key?
No. A UUID is an identifier, not a secret: it is designed to appear in URLs, logs, primary keys and query strings, so it cannot be kept confidential. The time-ordered variants leak their creation time on top of that. For something unguessable use the password generator with a length of 16 or more; for a real key, use a dedicated key management system rather than hand-rolling one.
v4 or v7 for a database primary key?
Use v7. Because it is time-ordered, new rows always append near the end of the index, so writes stay sequential. Random v4 keys keep splitting index pages, and the difference shows up quickly as a table grows. Go with v4 when you specifically do not want outsiders to infer when a record was created.
Is a batch of v7 values sorted?
Yes. Every v7 in one run shares the same millisecond timestamp and increments the 12-bit rand_a counter, so sorting the copied column reproduces the generation order exactly. That guarantee is per run; a second click starts a fresh batch.
ObjectId or UUID v7 — both are time-ordered, so which one?
Follow your database: use ObjectId for MongoDB (it is the default key type, and the drivers and indexes are tuned for it) and v7 everywhere else. Two differences are worth knowing. Resolution: the first four ObjectId bytes are seconds where v7 uses milliseconds, so two ObjectIds created in the same second cannot be ordered against each other from the ID alone. Size: ObjectId is 12 bytes against 16 for v7. And note that only 8 of those 12 bytes are random (five of per-process value plus three of counter), so an ObjectId is not an unguessable identifier — reach for v4 when unpredictability is the point.
Is anything uploaded or logged?
No. Randomness comes from the browser built-in crypto.getRandomValues, generation happens in memory on your machine, and the page makes no network requests. It works offline.

Related tools