Loading Techie Utils…

ULID to Timestamp

Read the creation time out of a ULID. Free, and runs entirely in your browser — nothing you enter is uploaded, stored or sent to a server.

About ULID / CUID Generator

A random primary key is the right default until the table gets big. UUID v4 is 122 random bits, so consecutive inserts land on random pages of the index: the tree fragments, the cache hit rate collapses, and writes that should be cheap are not. ULID, CUID2 and UUID v7 all exist because of that one problem.

ULID and UUID v7 solve it the same way — a millisecond timestamp at the front, so new values sort after old ones and inserts stay at the hot end of the index. ULID is the same 128 bits as a UUID but written in Crockford Base32, which makes it 26 characters instead of 36 and removes every character that can be misread. CUID2 deliberately refuses to sort: it hashes the time in rather than prefixing it, because a sortable public identifier tells anyone holding it when a row was created, and two of them reveal how fast the table is growing. That is the trade, and which side you want depends on whether the identifier is ever shown to anybody.

Where it helps

  • ULID sorts lexicographically in creation order, which keeps database inserts at one end of the index.
  • Crockford Base32 has no I, L, O or U, so a ULID can be read aloud or copied by hand without ambiguity.
  • CUID2 is offered for the opposite requirement: an identifier that discloses neither creation time nor volume.
  • All randomness comes from crypto.getRandomValues, never Math.random.

Limits

  • Every sortable identifier here leaks its creation time to anyone holding it — that is the mechanism, not a defect.
  • ULID is not a UUID: anything with a UUID column type will not take one. Use UUID v7 where the type is fixed.
  • Monotonicity within a single millisecond is not implemented, so two ULIDs made in the same millisecond may not sort in creation order relative to each other.
  • CUID2 gives up index locality by design, which is the very problem the other two are here to solve.

Frequently asked questions

ULID or UUID v7?

They carry the same information. Choose UUID v7 if anything in the stack expects a UUID — a database column type, an API contract. Choose ULID if you control the format and want something shorter and easier to read.

Is a ULID as unique as a UUID v4?

Close enough. It has 80 random bits per millisecond against v4's 122 overall, which means collisions require over a million ids in the same millisecond before the risk becomes worth thinking about.

Why would I want an identifier that does not sort?

Because a sortable id in a URL tells a competitor when you signed up your customers and how many you sign up per day. If the identifier is public, that disclosure is usually worse than the index cost.

Can I get the timestamp back out?

Out of a ULID, yes — it is the first ten characters, and this tool reads it. Out of a CUID2, no: that is the point of it.

Related tools

  • UUID Generator — UUID v1 to v7 — generate any version, or read what one encodes
  • Random String — Random identifiers from a chosen alphabet
  • Base32 — Encode or decode Base32 in the RFC 4648, extended hex and Crockford alphabets
  • Unix Timestamp — Convert between timestamps, ISO dates and local time
  • Nano ID Generator — Short, URL-safe random identifiers — and what the length actually buys
  • KSUID Generator — Sortable 27-character identifiers with a second of time and 128 bits of randomness

More Generators tools

  • UUID Generator — UUID v1 to v7 — generate any version, or read what one encodes
  • ULID / CUID Generator — Sortable, collision-resistant identifiers — and the timestamp inside one
  • Nano ID Generator — Short, URL-safe random identifiers — and what the length actually buys
  • KSUID Generator — Sortable 27-character identifiers with a second of time and 128 bits of randomness
  • TypeID Generator — Type-prefixed identifiers over UUID v7, readable and still a UUID underneath
  • ObjectID Generator — MongoDB's twelve bytes — a timestamp, a process value and a counter
  • Barcode Generator — Draw QR, Data Matrix, Code 128, EAN and more as SVG
  • QR Code Generator — Create scannable QR codes as SVG
  • UPI QR Code Generator — Make a UPI payment QR code that any UPI app can scan to pay you
  • Diagram Studio — Draw architecture, sequence, ER, C4, network and nine other diagrams by dragging shapes and connecting them
  • Random String — Random identifiers from a chosen alphabet
  • Lorem Ipsum — Placeholder paragraphs, sentences or words
  • Fake Data — Synthetic people and companies as JSON, CSV or SQL
  • Random Number Generator — Draw uniformly random integers or decimals in a range, with or without repeats