Skip to content
nah

UUID & Nano ID Generator

Generate UUID v4, UUID v7, and Nano IDs in bulk — instantly in your browser.

100% in your browser — files never leave your device

Type

How UUID and Nano ID generation work

UUID v4 is 122 bits of pure randomness with no inherent order. UUID v7 embeds a 48-bit millisecond timestamp in the first six bytes before the random remainder, which makes IDs sort chronologically as strings — the reason it's increasingly preferred for database primary keys, since sequential inserts land at the end of a B-tree index instead of scattering randomly through it.

Nano ID takes a different tradeoff: a 21-character ID built from a 64-character URL-safe alphabet, generated here with the same crypto.getRandomValues source as the UUIDs. At the default size its collision probability is comparable to UUID v4's, just shorter and dash-free — useful for short IDs in URLs or filenames.

All three generators draw from the Web Crypto API's cryptographically secure random source, not Math.random. Generation is capped at 1,000 IDs per batch and downloadable as a .txt file, which covers seeding a database or test fixture without needing a script.

Frequently asked questions

What is the difference between UUID v4 and UUID v7?

UUID v4 is entirely random — 122 random bits with no inherent ordering. UUID v7 embeds a 48-bit millisecond timestamp in the first 6 bytes, making the IDs lexicographically sortable by creation time. This matters for database primary keys: v7 inserts at the end of a B-tree index (good for performance) while v4 inserts randomly (causing index fragmentation).

What is Nano ID and when should I use it?

Nano ID produces URL-safe random IDs using a 64-character alphabet. A 21-character Nano ID has roughly the same collision probability as a UUID v4 but is shorter and has no dashes. Use it when you want compact, URL-friendly IDs and do not need the timestamp-sortable property of UUID v7.

Are the IDs generated securely?

Yes. All IDs use crypto.getRandomValues, the Web Crypto API, which is cryptographically secure. Nothing is sent to a server — generation happens entirely in your browser.

Related tools