UUID vs ULID vs UUIDv7 Generator on Mac: Which to Use
Choose UUIDv4, UUIDv7 or ULID for your ids, generate and decode them on a Mac with Terminal or Bytepliers, and avoid using ids as secrets.
GuideUpdated 7 min read
On this page
You have to pick an id format for a new table or API, and you keep seeing UUID, UUIDv7 and ULID. You also want to generate and inspect them on your Mac without a website. This guide covers the choice, the Terminal route and the Bytepliers route.
How UUIDv4, UUIDv7 and ULID differ
All three are 128 bits. They differ in how the bits are filled and how the id is written as text.
| UUIDv4 | UUIDv7 | ULID | |
|---|---|---|---|
| Text form | 36 characters with hyphens | 36 characters with hyphens | 26 characters, Crockford Base32 |
| What's inside | 122 random bits plus version and variant bits | 48-bit Unix millisecond timestamp, then random bits (plus version and variant bits) | 48-bit millisecond timestamp, then 80 random bits |
| Sorts by creation time | No | Yes, to the millisecond | Yes, to the millisecond |
| Reveals when it was made | No | Yes | Yes |
| Fits a native UUID column | Yes | Yes | Yes, after converting the text to UUID form |
| Standard | RFC 9562 | RFC 9562 | Community spec, not an RFC |
"Sorts by creation time" holds to the millisecond. Two ids made in the same millisecond have no guaranteed order unless the generator adds a counter, so don't treat id order as a strict sequence.
Which one to pick
Pick UUIDv4 if:
- the id appears in URLs or in front of users and shouldn't hint at when the record was created,
- you don't care about insert order in the index,
- you want the most widely supported format.
Pick UUIDv7 if:
- you want time-ordered keys and still want a standard UUID that columns, libraries and ORMs understand,
- insert locality matters. Random v4 keys scatter new rows across an index, while time-ordered keys land next to each other.
Pick a ULID if:
- you want a shorter, case-insensitive string (26 characters instead of 36),
- you accept a format that isn't an RFC. A ULID is still 128 bits, and it converts to and from a UUID.
What about v1? UUIDv1 stores a timestamp and a node field. People on programming forums have argued over whether v1 is impractical because it needs a stable MAC address. It doesn't strictly: implementations can fill the node with random bits. It still exposes a timestamp, and that timestamp isn't laid out for sorting, so v7 is the usual choice for ordered keys now.
Why time-ordered ids are not secrets
The same discussions raised a second point: a monotonic ULID generator is guessable. Monotonic generators increment the random part when two ids land in the same millisecond, so an id's neighbor from that millisecond is predictable. Even without that, a v7 or ULID tells anyone who sees it when it was created, and its first 48 bits are not random at all.
- Don't put a v7 or ULID in a password-reset link, an API key or a session token.
- If something must be unguessable, use a long random token from the system random generator. Treat even a v4 as an identifier, not a credential.
- Keep the two jobs apart: an id says "which record", a secret says "you're allowed".
For tokens, the Password Generator in Bytepliers has Hex and Base64URL modes. It uses the system random generator, shows "Generated locally · never saved to history", and marks copies as concealed for clipboard managers that honor that convention.
Generate UUIDs on a Mac in Terminal
macOS ships uuidgen. It prints one new UUID per run:
uuidgenmacOS prints uppercase. To lowercase it, which many databases and APIs prefer:
uuidgen | tr 'A-Z' 'a-z'Neither command changes your system, so there is nothing to undo. As of November 2026, the macOS man page documents one option, -hdr, which prints source code for using the UUID in a header. It can't select a version, make a ULID or produce a batch. For those you need a library in your language or a tool like Bytepliers.
Read the timestamp out of a UUIDv7 by hand
The first 12 hex digits of a v7 UUID are the Unix time in milliseconds. For 018bcfe5-6800-7abc-8def-0123456789ab, those are 018bcfe5 and 6800, joined as 018bcfe56800. Convert to decimal, then to a date:
echo $((16#018bcfe56800))
date -u -r $((16#018bcfe56800 / 1000))The first command prints 1700000000000 (milliseconds). The second divides by 1000 and prints the UTC date, November 14, 2023 at 22:13:20. Both only read and print.
Generate UUID, UUIDv7 and ULID with Bytepliers
The UUID / ULID tool works offline.
- Open Bytepliers and press ⌘6 (Command-6), or pick UUID / ULID in the sidebar under Generate.
- In the Generate pane, open Kind and choose UUID v1, v3, v4 (the default), v5, v6, v7, ULID, Nano ID, ObjectId or KSUID.
- Set the count (1 to 1000, default 5).
- Toggle Uppercase or Hyphens as needed. Hyphens apply to UUIDs and are on by default.
- Press ⌘R (Command-R) to regenerate, and ⇧⌘C (Shift-Command-C) to copy the output.
For v3 and v5 you also pick a namespace (DNS, URL, OID, X.500 or Custom) and give one name per line, so the same name always gives the same UUID. Nano ID has a size from 2 to 256 (default 21) and an editable alphabet.
Decode a UUID, ULID or other id
Decoding answers "what is this id, and when was it made?"
- Open UUID / ULID (⌘6).
- Paste the id into the decode field ("UUID, ULID, ObjectId, Snowflake or KSUID"). It accepts UUIDs in canonical, braced, URN and 32-hex forms, plus Base64 and URL-safe forms.
- Read Structure: version, variant, time, clock sequence, node and random bits.
- Open Conversions (collapsed by default) for hex, Base64, the 128-bit decimal, bytes, and ULID ↔ UUID.
For Snowflake ids, pick the epoch, "Twitter / X" or "Discord". In the Generate pane, Decode the first ID decodes the first id you generated.
A v4 id has no timestamp, so there is no meaningful time to read. Decoding a v7 or ULID is a quick way to confirm your generator is time-ordered and to see what you give away by exposing that id.
Generate ids from the command line
Install the bytepliers command from Settings > Integrations > Command-Line Tool > Install… (see the command-line page). Then:
bytepliers uuid --v7 -n 5
bytepliers uuid --ulid -n 3
bytepliers uuid--v4 is the default. The count can be 1 to 10,000, and ULIDs are always printed in uppercase. To write a batch to a file:
bytepliers uuid --v7 -n 1000 > ids.txtThe CLI needs an active trial or license, and Bytepliers must have been opened at least once.
Fixes when something goes wrong
| Symptom | Cause | Fix |
|---|---|---|
| "Unknown format" when decoding | Not a UUID, ULID, ObjectId, Snowflake or KSUID, or a truncated copy | Check for stray characters or missing digits |
| Decoded id shows no time | It's a v4 | Check the version in Structure |
| Hand-decoded time looks wrong | v1 and v6 count time differently from Unix milliseconds | Only read v7 and ULID this way; for a millisecond value, use the Unix Timestamp tool (see converting a Unix timestamp) |
| Database treats ids as different | uuidgen prints uppercase | Lowercase with tr, or turn Uppercase off |
command not found: bytepliers | Installed to ~/.local/bin, which isn't on PATH | Add it to PATH, or reinstall into /usr/local/bin |
| "Open Bytepliers once to enable the command-line tool." | The CLI access pass hasn't been written yet | Launch the app once, then rerun |
Checklist before you choose
- Does the id need to sort by creation time? If not, v4.
- Are you fine with the id revealing its creation time? If not, v4.
- Do you need a standard that every UUID column and library accepts? Prefer v7 over ULID.
- Is a 26-character string important? Then ULID.
- Is the id guarding anything? Add a real random token instead.
If nothing works
If Bytepliers misbehaves, contact support through the support page and include the exact error text, the app version, your macOS version and the steps you tried.
Subject: Bytepliers UUID / ULID tool problem
Bytepliers version: (Help menu or About window)
macOS version:
What I did: chose Kind = UUID v7, count 5, pressed Command-R
What I expected:
What happened (exact message):
Already tried: restarting the app, Settings > Advanced > Reset…Common questions
Is UUIDv7 better than ULID?
For most projects UUIDv7 is the easier default: it's standardized, fits UUID columns and libraries, and sorts the same way. Choose ULID if you want the shorter 26-character string.
Can I convert a ULID to a UUID?
Yes, both are 128 bits and only the text form differs. Bytepliers shows the conversion under Conversions.
Should I use an auto-increment id instead?
That is a separate trade-off. Auto-increment ids are small and sortable, but guessable and they reveal your record count. As with v7 and ULID, don't use them as secrets.
Bytepliers is part of MacSuite, with a 7-day free trial (see pricing). For more, see the UUID generation guide and the Bytepliers tool reference.