Flutter 3.50 is live! Read the blog post

UUID Generator

Generate RFC-4122 v4 UUIDs using crypto.randomUUID()

5

Related Tools

// more about this tool

Why use this tool

A UUID (universally unique identifier) is a 128-bit value formatted as 32 hex digits in five groups, like 550e8400-e29b-41d4-a716-446655440000. Version 4 means it's generated almost entirely from random bits rather than derived from a timestamp or a hardware address, which is why two v4 UUIDs colliding is astronomically unlikely even generated on completely unrelated machines with no coordination.

Reach for one as a primary key for database rows where you don't want a predictable, guessable, sequential integer ID exposed in a URL; as an idempotency key for API requests, so a retried request doesn't create a duplicate; or for temporary file names and test fixture IDs where you need a unique identifier without a central authority handing them out.

How it works

  1. Set how many UUIDs you want with the count slider, from 1 to 20.
  2. Toggle Uppercase if your downstream system expects uppercase hex digits.
  3. Click Generate to produce the batch using crypto.randomUUID().
  4. Copy one individually, or use Copy all to grab the whole newline-separated batch at once.

Example

A generated v4 UUID

9c858f1e-3b2a-4f7d-8e4a-1d6c5b9a7f3e

FAQ

Are v4 UUIDs guaranteed unique?

Not mathematically guaranteed, but the collision probability is astronomically low: with 122 random bits, you'd need to generate roughly a billion UUIDs per second for about 85 years before a 50% chance of a single collision.

Why not just use an auto-increment integer instead?

A sequential integer leaks information — it tells anyone watching how many rows exist and lets them guess adjacent IDs. A UUID carries no such signal and can be generated client-side before a row is even inserted, which simplifies offline-first and distributed systems.

Is this safe to use for session tokens?

Not by itself. A UUID is unique, not secret-strength unpredictable in the way a cryptographic session token needs to be, and it isn't signed or tied to an expiry. Use a dedicated signed token (like a JWT) for authentication; reserve UUIDs for identifiers that don't need to resist a determined guesser.

Does this tool work if crypto.randomUUID() isn't available?

It falls back to a Math.random()-based polyfill in that case, which is extremely rare in any modern browser — crypto.randomUUID() has been supported broadly since 2022.

Why does every v4 UUID have a 4 in the same position?

The version number (4) is encoded directly into the UUID's structure at a fixed position, and the variant bits in the following group are constrained to a small fixed set of values — that's why every v4 UUID has the pattern xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where x is fully random and y is restricted to 8, 9, a, or b.