·5 min read·Blog

How to Generate a UUID Online for Free (v4, v1, and What the Difference Is)

UUID versions look similar but are generated differently — v1 embeds your MAC address and timestamp, which has privacy implications. Here's what to use and when.

What a UUID is

A UUID (Universally Unique Identifier) is a 128-bit value formatted as 32 hexadecimal digits in five groups: 550e8400-e29b-41d4-a716-446655440000.

UUIDs are used as database primary keys, session identifiers, file names, API tokens, and anywhere you need a unique value that can be generated without a central coordination system. Two independently generated UUIDs have an astronomically small probability of collision.

UUID versions explained

Version 4 (v4) — Random

UUID v4 is generated from 122 bits of cryptographic randomness. The remaining 6 bits indicate the version and variant. Example:

f47ac10b-58cc-4372-a567-0e02b2c3d479

Version indicator: the 4 in the third group is always 4 for v4.

Use v4 for: database primary keys, session IDs, file identifiers, API keys — any situation where you need a unique identifier and sortability by creation time is not required.

Version 1 (v1) — Timestamp + MAC address

UUID v1 embeds the current timestamp (100-nanosecond intervals since October 15, 1582) and the MAC address of the generating machine. Example:

6ba7b810-9dad-11d1-80b4-00c04fd430c8

Privacy concern: v1 UUIDs reveal when they were generated and can reveal the MAC address of the server that generated them. In 2023, this was implicated in identifying servers in several security disclosures.

Use v1 for: distributed systems where time-ordering of events matters and privacy is not a concern — for example, internal event logs where knowing the generation order is useful.

Version 7 (v7) — The modern choice

UUID v7 (standardized in 2022) combines a Unix timestamp prefix with random bits. It is sortable by creation time (like v1) but uses random bits instead of MAC addresses (safe like v4). It is the recommended choice for new systems that need time-ordered UUIDs.

Example: 018e6180-abcd-7abc-8def-012345678901 — the first 12 hex digits encode the Unix timestamp in milliseconds.

How to generate a UUID free

  1. Open the free UUID generator
  2. Select the version (v4 for most uses, v1 if you need timestamp ordering)
  3. Click Generate or copy one of the generated UUIDs

UUIDs are generated in your browser using the Web Crypto API (crypto.randomUUID() for v4) — nothing is sent to any server.

Using UUIDs as database primary keys

UUID primary keys have tradeoffs compared to sequential integer IDs:

  • Pro: can be generated client-side before a database insert — useful for offline-capable apps and distributed systems
  • Pro: does not reveal record count or creation order (security advantage)
  • Con: larger storage size (16 bytes vs 4 bytes for int)
  • Con: random UUIDs (v4) cause B-tree index fragmentation — inserts are slower on large tables. UUID v7 fixes this because its timestamp prefix keeps insertions roughly sequential.

Validating a UUID

A valid UUID matches this regex pattern:

^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

Test UUID strings and other patterns with the free regex tester.

Summary

  • v4: random, private, no ordering — use for most identifiers
  • v1: timestamp + MAC address — time-ordered but reveals server identity
  • v7: timestamp prefix + random — best of both, use for new systems needing time-sortable IDs
  • Generate UUIDs free with the UUID generator — runs in your browser

Browse by category

Not sure which tool you need? Start with a category.

Everything you can do — for free

No software to buy. No account to create. Just open a tool and get it done.

Work with images

Compress photos before sending them by email, resize pictures for social media, remove backgrounds, or pick the perfect color for a design project — all without installing any app.

Edit and format text

Count words and characters in an essay, compare two documents side by side, convert text to different formats, or generate placeholder text for a presentation.

Stay safe online

Create a strong unique password in one click, check how secure a password is, encode or decode data, and generate secure tokens — your data never leaves your device.

Calculate anything

BMI, loan repayments, unit conversions, date differences, and dozens of other everyday calculations — no spreadsheet or formula knowledge required.

The Free AI Tools is a free collection of 221+ online tools that work directly in your web browser — no download, no installation, no account required. Whether you need to compress an image for email, count words in an essay, generate a strong password, create a QR code for your business, or format JSON for development — you will find a simple, free tool here.

Every tool is privacy-first: your files, text, and data never leave your device. Tools cover image editing, text processing, developer utilities, security & encoding, SEO & web, design & CSS, and more.

☕ Support Us