toolbench.onlineby Valkyron Labs

ID Generators

ULID Generator and Decoder

Mint a batch of sortable ULIDs for database rows and event logs, then read the creation time back from an identifier you already have on hand.

ULID Generator and Decoder

Generate sortable ULIDs and read the embedded timestamp.

Timestamp inspection

—

ULID output

No ULIDs generated yet.

Output actions

Ready to copy output once your result appears.

Ten time characters, then sixteen random

ULID Generator and Decoder draws 26-character identifiers and can read the time back out of one. How many ULIDs? (1-500) starts at 10. Generate ULIDs fills ULID output with one id per line, using the browser clock and crypto.getRandomValues. Reset batch clears that list. ULID to decode plus Inspect timestamp prints a UTC timestamp for a 26-character value whose first character is 0–7. Copy output and Download output follow the generated lines, not the inspection sentence.

How to generate and decode a ULID

  1. 1Set How many ULIDs? (1-500). The field starts at 10. A click clamps a blank, a decimal, or an out-of-range entry into 1–500, and the field then shows that integer.
  2. 2Press Generate ULIDs. ULID output lists one uppercase id per line. Press Reset batch to clear the list. An empty list shows No ULIDs generated yet.
  3. 3Paste a 26-character value into ULID to decode and press Inspect timestamp. A match prints UTC timestamp: and an ISO time. Anything else prints Enter a valid 26-character ULID (first character 0–7).

What it is good for

  • • Drawing a short batch of time-sortable ids, up to 500 lines, for a local fixture.
  • • Reading 01ARZ3NDEKTSV4RRFFQ69G5FAV as 2016-07-30T23:54:10.259Z.
  • • Seeing that a value starting with 8 is rejected even when the other 25 characters look right.

Example

Input

01ARZ3NDEKTSV4RRFFQ69G5FAV in ULID to decode

Output

UTC timestamp: 2016-07-30T23:54:10.259Z

Generate ULIDs draws new ids from the current clock, so those lines change on every click. Lowercase 01arz3ndektsv4rrffq69g5fav decodes to the same instant. The inspection field is separate from the batch.

Where the clock sits in the 26 characters

The alphabet is Crockford base32: 0123456789ABCDEFGHJKMNPQRSTVWXYZ. I, L, O, and U are absent so they are not confused with 1 and 0. Each character is 5 bits. The first 10 characters are a 48-bit millisecond timestamp, most significant character first. The other 16 characters are the random half. The page builds the time half from Date.now and the random half by taking 16 bytes from crypto.getRandomValues and keeping each byte modulo 32. The text is those 26 characters with no hyphens. The generator's own alphabet never emits I, L, O, or U.

Inspect timestamp trims the field, uppercases it, and requires a first character from 0 to 7 followed by 25 alphabet characters. A leading 8 would overflow the 48-bit time, so 81ARZ3NDEKTSV4RRFFQ69G5FAV is rejected. The first 10 characters are then converted back to a millisecond count and printed with toISOString. 01ARZ3NDEKTSV4RRFFQ69G5FAV prints 2016-07-30T23:54:10.259Z. The random half is not shown and is not checked for uniqueness. Lowercase input is accepted because the field is uppercased before the test.

Quantity, Generate ULIDs, and Inspect timestamp

How many ULIDs? (1-500) starts at 10. Generate ULIDs uses an integer from 1 to 500. A decimal is truncated toward zero. A blank, zero, or a non-number becomes 1. A number past 500 becomes 500. The field is rewritten to that integer, then the lines are drawn. Reset batch empties the list and the copied text. It does not put 10 back, and it does not clear ULID to decode. Inspecting does not change the batch. There is no uppercase switch and no switch that inserts hyphens.

Copy output and Download output read the generated lines, one id per line. The inspection sentence stays in Timestamp inspection. The download file is ulid-generator.txt. A fresh visit starts with an empty batch. If you need more than 500 lines, generate again and append the copy yourself. The UUID generator draws version 4, up to 1,000 lines, with case, hyphen, and brace switches. Those ids do not sort by time and this page will not decode them.

When a ULID is the id you want

Use this spelling when new rows should roughly follow creation order in a text sort and the column stores a 26-character string rather than a hyphenated UUID. The time prefix is why a later click usually sorts after an earlier one. That is not a promise about a database index. The engine and the column type decide whether the prefix helps. A random UUID is the better fit when the id must not reveal when it was minted. UUID version 7 is a hyphenated UUID with its own millisecond prefix. The UUID v7 generator draws that form and has its own inspector.

Anyone who can read the ULID can read the time. That is useful in a fixture and a poor session secret. A MongoDB document that should use the 12-byte default id belongs on the ObjectID generator. A comparison of version 4, version 7, and ULID, including what a time prefix does not guarantee, is in UUID v4 vs UUID v7 vs ULID. This page does not look an id up in a database.

Same-millisecond draws and letters the alphabet skips

The page does not keep a counter between clicks or inside a batch. Two ids drawn while Date.now is the same millisecond share a time prefix, and the remaining 16 characters are a fresh random fill. Their sort order is the sort order of those characters, not the order of the lines. A batch of 500 drawn inside one millisecond can list a later line that sorts before an earlier line. Waiting for the clock to move is the only way this page separates the prefixes. The random half is also slightly biased, because each byte is reduced with modulo 32 rather than taken as a full 80-bit string of unbiased 5-bit groups.

The prefix is the browser clock, not a server clock. A laptop set five minutes fast stamps every new id five minutes fast, and Inspect timestamp will report that fast time. A value someone else assembled with a chosen prefix still decodes. The inspector does not prove a remote event happened then. I, L, O, and U fail the alphabet test even when the rest of the string is plausible. A UUID, a 25-character string, and a leading 8 all print Enter a valid 26-character ULID (first character 0–7).

Rules and limitations

Quantity is clamped to an integer from 1 to 500, starting at 10. Each id is 10 Crockford time characters from Date.now plus 16 characters from crypto.getRandomValues bytes modulo 32. I, L, O, and U are not in the alphabet.

Inspect timestamp accepts a 26-character value with a first character 0–7 and prints the first 10 characters as a UTC ISO time. Reset batch clears the generated lines only. Copy and download are those lines.

Common problems

If two lines from one click sort out of click order, they share a millisecond and the random half decided the order. This page has no monotonic counter.

If Inspect timestamp rejected a string that looks almost right, look for I, L, O, U, a first character past 7, or a length other than 26. Lowercase is fine.

Frequently asked questions

How many ULIDs can one click draw?

From 1 to 500. The field starts at 10. A blank or a non-number becomes 1, a decimal is truncated, and a larger entry becomes 500.

Will two ids from the same millisecond stay in click order?

Not necessarily. They share a time prefix, and the other 16 characters are random. This page does not keep a counter.

Why are I, L, O, and U rejected?

Crockford base32 omits them so they are not read as 1 or 0. The generator never emits them, and the inspector rejects them.

Is the embedded time a secret?

No. Anyone who can see the id can read the millisecond time. Do not use that id as a session token or a password.

Is my input uploaded or saved?

This tool processes input in your browser and does not save its input or output to local storage. Copy and download are user actions. The site uses analytics for page and action metadata and may use ads and production error reporting; see the Privacy Policy for those services.

About this tool

Maintained by Toolbench. For large or deeply nested files, split the input into smaller batches and verify representative results before using them in an import or application. Report reproducible problems through Contact.

Guides

Next steps

Related tools

Continue the workflow with nearby tools for formatting, publishing, debugging, or follow-up checks.

Trust

Policies, contact, and answers

Clear pages for how Toolbench works, what we collect, and how to reach us.