Skip to content
faker.tools
All 79

Plate IV · Developer, API & Database Seeding Utilities

UUID, ULID & Nano ID Generator

Eight identifier formats, including time-ordered UUID v7 and ULID.

#Identifier
1aebeb47b-4a13-415c-83dc-755f036d8792
2504f72ec-22d0-4b11-8dc4-16b3d853a4e0
3e5494da5-b890-4309-ba87-a0a44e656df0
4f76d4376-3213-41a1-8ef2-79b4855eac03
566055393-5feb-4c9e-ae3e-16f732a09501
60f77c060-a662-4c5c-8376-fc09843d87b9
794fde933-6a8a-443a-835c-2f71689862b1
8bb940548-d0b5-4962-8b41-4660e6891127
97ce9a53a-bd19-452d-b873-5eec5ef52123
109a1958d0-4dd3-44c6-8482-0aa12fe33486
10 rows · 369 BGenerated in your browser · UUID, ULID & Nano ID Generator

UUID v4 is random, which makes it terrible as a primary key — every insert lands in a different page of the index. UUID v7 and ULID put a timestamp in front, so they sort by creation time and insert sequentially. Both are here, and both are correctly ordered across a batch.

What you can control

  • Time-ordered formats increase monotonically down the batch, so you can verify sort order at a glance.
  • The embedded timestamp can be shown as its own column for v7, ULID and ObjectId.
  • Hyphens, braces and casing are all optional, covering the variations different systems store.
  • Nano ID length is adjustable from 8 to 40 characters for trading collision risk against URL length.

What this is not

These come from a seeded pseudo-random generator, so collision resistance is nothing like a real UUID library's. Use crypto.randomUUID() in production.

Questions

Should I use v4 or v7 for a database key?

v7, in almost every case. Its leading timestamp means new rows insert at the end of the B-tree instead of scattering across it, which keeps write performance and index locality intact.

Are these safe to use as real identifiers?

No. The generator is seeded and deterministic, so the same seed reproduces the same IDs. Use your platform's crypto random source in production.

What is a ULID?

A 26-character identifier in Crockford base32: 48 bits of timestamp then 80 bits of randomness. It sorts lexicographically by time and is case-insensitive and URL-safe.

Next in Developer

All 11