Skip to content

What is a UUID?

Learn what UUIDs are, how versions differ (especially v4 vs v7), and how to generate identifiers locally without a server.

A UUID (Universally Unique Identifier) is a 128-bit value usually written as 36 characters with hyphens, like 550e8400-e29b-41d4-a716-446655440000. Systems use UUIDs for database keys, request IDs, and resource names when they need uniqueness without a central counter.

Versions you will meet

  • Version 4 — mostly random. Ubiquitous and private about creation time.
  • Version 7 — time-ordered. Improves index locality for heavy inserts, but exposes coarse timing.
  • Other versions exist (time-based v1, name-based v3/v5); pick deliberately.

Read UUID v4 vs UUID v7 when you are choosing a default for a new system.

Design trade-offs

Random v4 IDs scatter across B-tree indexes, which can hurt write-heavy tables. Time-ordered IDs cluster newer rows together. Neither version is a substitute for authentication secrets: uniqueness is not confidentiality.

Generation hygiene

  1. Prefer platform crypto APIs over homemade randomness.
  2. Document which UUID version each field uses.
  3. Do not parse meaning out of v4 bits beyond the version/variant nibbles.
  4. For v7, confirm library support before standardizing.

Practice on ToolHub

Generate IDs with UUID Generator. When you need digests instead of identifiers, use Hash Generator. Both run locally in your browser.

Related topics

If you validate UUID-shaped strings in logs, What is Regex? helps you test patterns carefully. For auth identifiers carried in tokens, see What is JWT?.

Try related tools

Keep exploring