Developer UUID tools

JavaScript UUID Generator

Generate UUIDs for JavaScript and TypeScript projects, then review browser-native crypto.randomUUID() and validation patterns.

JavaScript UUID generator

Create UUID values in the browser for frontend fixtures, tests, API payloads, and documentation examples.

123e4567-e89b-42d3-a456-426614174000
123e4567-e89b-42d3-a456-426614174001
123e4567-e89b-42d3-a456-426614174002
123e4567-e89b-42d3-a456-426614174003
123e4567-e89b-42d3-a456-426614174004
123e4567-e89b-42d3-a456-426614174005
123e4567-e89b-42d3-a456-426614174006
123e4567-e89b-42d3-a456-426614174007
123e4567-e89b-42d3-a456-426614174008
123e4567-e89b-42d3-a456-426614174009
Output options

Generate 1 to 1000 IDs per batch.

Generated values stay in your browser. This page does not send UUIDs or GUIDs to a server for generation.

crypto.randomUUID() example

Modern browsers and current Node.js releases support crypto.randomUUID() for UUID v4 generation.

Generate a UUID in JavaScript
const id = crypto.randomUUID();
console.log(id);
Validation regex example
const uuidRegex =
  /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;

console.log(uuidRegex.test("123e4567-e89b-42d3-a456-426614174000"));

getRandomValues fallback note

When crypto.randomUUID() is unavailable, generate random bytes with crypto.getRandomValues() and set the UUID version and variant bits correctly.

Avoid Math.random() for serious UUID generation. It is not designed for cryptographic randomness and can produce weaker identifiers.

FAQ

What is the easiest way to generate a UUID in JavaScript?+

Use crypto.randomUUID() when it is available. It returns a UUID v4 string.

Should I use Math.random() for UUIDs?+

Avoid Math.random() for serious UUID generation. Prefer crypto.randomUUID() or crypto.getRandomValues().

Does this page generate UUIDs client-side?+

Yes. The live generator runs in your browser and uses browser crypto APIs.