UUID generators are everywhere. Most of them work. But a surprising number use Math.random() under the hood, which is not cryptographically random β it's a pseudorandom number generator seeded from system time.
I built a UUID Generator using crypto.randomUUID() and crypto.getRandomValues(), with bulk generation, copy support, and format options. All in the browser.
π https://uuid-generator-bsf.pages.dev/
Why crypto.randomUUID() and Not Math.random()?
For UUIDs used as database primary keys or session identifiers, the uniqueness guarantee matters. Math.random() is deterministic given the same seed and is not suitable for security-sensitive random number generation.
crypto.randomUUID() uses a CSPRNG (cryptographically secure pseudorandom number generator) internally and produces a properly formatted v4 UUID per RFC 4122:
const uuid = crypto.randomUUID();
// "f47ac10b-58cc-4372-a567-0e02b2c3d479"
Position 13 is always 4 (version), and position 17 is always 8, 9, a, or b (variant). The spec guarantees this. Math.random() implementations don't.
Fallback for Older Environments
For environments without crypto.randomUUID(), there's a manual implementation using crypto.getRandomValues():
function uuidv4Fallback() {
const b = crypto.getRandomValues(new Uint8Array(16));
b[6] = (b[6] & 0x0f) | 0x40; // version 4
b[8] = (b[8] & 0x3f) | 0x80; // variant
const h = [...b].map(x => x.toString(16).padStart(2, "0"));
return `${h.slice(0,4).join("")}-${h.slice(4,6).join("")}-${h.slice(6,8).join("")}-${h.slice(8,10).join("")}-${h.slice(10).join("")}`;
}
Setting version and variant bits manually ensures the output is a valid v4 UUID even without the high-level API.
What the Tool Includes
- Single UUID generation β one click, instantly copied
- Bulk generation β specify a count, get a list; useful for seeding test databases
- Per-UUID copy and copy all buttons
- Uppercase/lowercase toggle β some systems require uppercase UUIDs
-
Hyphen toggle β some APIs want
f47ac10b58cc4372a5670e02b2c3d479without separators - Fully offline β generation never touches a network
Validated Against Format Requirements
Test coverage includes:
- Version bit: position 13 is always
4 - Variant bit: position 17 is always
8,9,a, orb - Total length: always 36 characters (32 hex + 4 hyphens)
- Bulk generation: 10,000 UUIDs produced with zero duplicates
- Uppercase/lowercase and hyphen modes produce correct output formats
58/58 passing tests.
No Framework, No External Libraries
A UUID generator has one meaningful state: the list of generated UUIDs. There's no component hierarchy, no data flow, no need for a virtual DOM. A single HTML file with ~100 lines of vanilla JS handles it.
This is devnestio's standard: single HTML file, zero CDN dependencies. After the first page load, it works entirely from browser cache β offline, on a plane, in a restricted environment.
What's Next
- UUID v7 support β time-sortable UUIDs, increasingly popular as database primary keys
- ULID generation β another time-ordered unique ID format
- UUID validation and parsing β check whether a string is a valid UUID and what version
UUID v7 is particularly interesting: it encodes the timestamp in the first 48 bits, making them naturally sortable by creation time without a separate created_at column. Worth adding if there's demand.
Try It
For test data, mock APIs, or any time you need a few UUIDs without opening a terminal:
π UUID Generator β devnestio
All tools: https://devnestio.pages.dev
No ads, no server, no tracking. Just UUIDs.
United States
NORTH AMERICA
Related News

Tesla settles lawsuit over fatal pedestrian crash involving Full Self-Driving
4h ago
I built CarvePHP: finding service boundaries in Laravel monoliths
4h ago

π Introducing CloudOps Blog β Practical AWS, Kubernetes & DevOps Guides
4h ago
What 10,000 domains actually publish for email authentication in 2026
12h ago
Privacy-Preserving Active Learning for heritage language revitalization programs during mission-critical recovery windows
11h ago