UUID Generator โ Generate UUID Online Free
Need to generate a UUID online in seconds? You're in the right place. This free UUID / GUID generator lets you create one or hundreds of universally unique identifiers instantly โ no sign-up, no tracking, all processing runs in your browser. Whether you need a UUID v4, UUID v7, UUID v1, or UUID v5, read on to understand the differences, pick the right version, and find ready-to-use code snippets for every major language and platform.
What Is a UUID (Universally Unique Identifier)?
A UUID (Universally Unique Identifier), sometimes called a GUID (Globally Unique Identifier, the term Microsoft popularised), is a 128-bit number used to identify information in computer systems without central coordination. It is standardised by RFC 9562 (formerly RFC 4122) and represented as 32 hexadecimal digits separated by hyphens in the format:
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
โ โ โ
โ โ โโ Variant bits (N)
โ โโโโโโโ Version digit (M)
โโโโโโโโโโโโโโโโโโโโโโโโ 32 hex chars = 128 bits total
A real example of a random UUID v4:
550e8400-e29b-41d4-a716-446655440000
The total number of possible UUIDs is 2128 โ roughly 340 undecillion. The probability of generating a duplicate by accident is astronomically low, which is why UUIDs are trusted as database primary keys, API request IDs, session tokens, distributed transaction IDs, file names, and more.
UUID vs GUID โ What's the Difference?
Technically, UUID is the IETF standard term while GUID is Microsoft's implementation used in Windows, COM, and .NET. They share the same 128-bit structure and the same hyphenated hex format. An online GUID generator and a UUID generator produce interchangeable output. You'll see both terms in job descriptions, documentation, and Stack Overflow answers โ they mean the same thing.
UUID Versions Explained โ v1, v3, v4, v5, v7
Not all UUIDs are created equal. There are several versions, each suited to different use cases.
| Version |
Source of Uniqueness |
Sortable? |
Best For |
| v1 |
Timestamp + MAC address |
Partially |
Time-ordered IDs, event logs |
| v3 |
MD5 hash of namespace + name |
No |
Deterministic IDs (legacy) |
| v4 |
Cryptographically random |
No |
General purpose โ most popular |
| v5 |
SHA-1 hash of namespace + name |
No |
Reproducible IDs from a name |
| v7 |
Unix timestamp + random bits |
Yes |
Databases โ replaces v1 & v4 |
UUID v4 Generator โ The Go-To Choice
UUID v4 is the most widely used version. All 122 non-fixed bits are filled with cryptographically secure random data, making it impossible to predict or reverse-engineer. It is the default for most frameworks, ORMs, and cloud services. Use a UUID v4 generator when you need a random, opaque, globally unique ID and you don't need time-ordering.
UUID v7 Generator โ The Modern Default
UUID v7 is the newest version (RFC 9562, 2024) and is rapidly becoming the preferred choice for database primary keys. It embeds a Unix millisecond timestamp in the most significant bits, so UUIDs generated in sequence are also lexicographically sortable. This dramatically improves B-tree index performance in PostgreSQL, MySQL, and other relational databases compared to v4. Use a UUID v7 generator for any new project where you store UUIDs as primary keys.
UUID v1 Generator โ Timestamp + MAC
UUID v1 combines a 60-bit timestamp (100-nanosecond intervals since October 1582) with the MAC address of the generating machine. While it provides natural time ordering, the inclusion of a MAC address raises privacy concerns โ an observer can infer when and on which machine a UUID was created. Prefer v7 over v1 for all new work.
UUID v5 / UUID v3 โ Name-Based Deterministic IDs
UUID v5 (SHA-1) and UUID v3 (MD5) generate a UUID from a namespace UUID plus a name string. Given the same inputs, you always get the same output UUID. This is useful for content-addressing, deduplication, or generating stable IDs from URLs or email addresses. Prefer v5 over v3 since SHA-1 is more collision-resistant than MD5, though neither is cryptographically secure for adversarial scenarios.
How to Generate a UUID โ Code Examples for Every Platform
Below are production-ready snippets for the most searched languages and platforms. Copy and go.
JS
JavaScript โ crypto.randomUUID()
Modern browsers and Node.js 14.17+ expose a native crypto.randomUUID() method that generates a cryptographically secure UUID v4 with zero dependencies:
// Browser & Node.js 14.17+
const uuid = crypto.randomUUID();
console.log(uuid);
// โ "110e8400-e29b-41d4-a716-446655440000"
// Node.js (alternative via built-in module)
import { randomUUID } from 'node:crypto';
const id = randomUUID(); // UUID v4
For UUID v7 in JavaScript, use the popular uuid npm package:
npm install uuid
import { v4 as uuidv4, v7 as uuidv7 } from 'uuid';
console.log(uuidv4()); // Random UUID v4
console.log(uuidv7()); // Sortable UUID v7 (timestamp-based)
PY
Python โ uuid.uuid4()
Python's standard library includes the uuid module. No install required. Python uuid4 generates a secure random UUID:
import uuid
# UUID v4 โ random
print(uuid.uuid4())
# โ UUID('3fa85f64-5717-4562-b3fc-2c963f66afa6')
# UUID v1 โ timestamp + MAC
print(uuid.uuid1())
# UUID v5 โ deterministic (SHA-1 of namespace + name)
print(uuid.uuid5(uuid.NAMESPACE_URL, 'https://ezytoolbox.com'))
# As a plain string
my_id = str(uuid.uuid4())
print(my_id)
JAVA
Java โ UUID.randomUUID()
Java ships with java.util.UUID. The static UUID.randomUUID() method returns a type 4 (pseudo-random) UUID:
import java.util.UUID;
// Generate UUID v4
UUID id = UUID.randomUUID();
System.out.println(id.toString());
// โ "b3d4b0e2-6b91-4f4c-a5e6-2f3d4c5e6f7a"
// Parse an existing UUID string
UUID parsed = UUID.fromString("550e8400-e29b-41d4-a716-446655440000");
System.out.println(parsed.version()); // โ 4
System.out.println(parsed.variant()); // โ 2
SQL
PostgreSQL โ gen_random_uuid()
PostgreSQL 13+ includes gen_random_uuid() natively (no extension needed) to generate a UUID v4. For UUID v7 support, use the pg_uuidv7 extension:
-- UUID v4 (built-in, PostgreSQL 13+)
SELECT gen_random_uuid();
-- โ a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
-- Use as default primary key
CREATE TABLE orders (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMPTZ DEFAULT now()
);
-- UUID v7 via pg_uuidv7 extension
CREATE EXTENSION IF NOT EXISTS pg_uuidv7;
SELECT uuid_generate_v7();
-- Lexicographically sortable, great for indexed PKs
CLI
Linux โ Command to Generate UUID
On Linux, the uuidgen command (from the util-linux package) is the fastest way to generate a UUID from the terminal:
# Generate a single UUID (v4 random by default on most distros)
uuidgen
# Force UUID v4 (random)
uuidgen --random
# Force UUID v1 (time-based)
uuidgen --time
# Read from /proc (kernel-generated)
cat /proc/sys/kernel/random/uuid
# Generate 5 UUIDs in a shell loop
for i in {1..5}; do uuidgen; done
PS
PowerShell โ Generate GUID
Windows developers use PowerShell to generate a GUID via the .NET [System.Guid] class:
# Generate a GUID
[System.Guid]::NewGuid().ToString()
# โ "a987fbc9-4bed-3078-cf07-9141ba07c9f3"
# Uppercase format (common in Windows)
[System.Guid]::NewGuid().ToString().ToUpper()
# Wrapped in braces (registry style)
"{$([System.Guid]::NewGuid().ToString().ToUpper())}"
# โ "{A987FBC9-4BED-3078-CF07-9141BA07C9F3}"
# Using New-Guid cmdlet (PowerShell 5+)
New-Guid
UUID Validator โ Check If a UUID Is Valid
A UUID validator online checks that a string conforms to the standard UUID format. Validation catches typos, truncated IDs, and malformed inputs before they reach your database. A valid UUID must match this structure:
- 32 hexadecimal characters (
0โ9, aโf)
- Grouped as
8-4-4-4-12 with hyphens
- Version digit (5th group, position 14) is
1โ8
- Variant bits (position 19) are
8, 9, a, or b
To validate or parse a UUID you can use the UUID Validator built into this tool above, or use a regex (see below).
UUID Decoder / UUID Parser โ Reading a UUID's Fields
A UUID decoder (also called a UUID parser) extracts the embedded metadata from a UUID string. For example, from a UUID v1 you can recover the exact timestamp it was created and the originating MAC address. From a UUID v4 you can confirm it is purely random. From a UUID v7 you can extract the Unix millisecond timestamp.
Here's how to decode a UUID manually:
Example: 019123ab-cdef-7000-8000-000000000001
โ โ โ
โ โ โโโ Variant: 8 โ RFC 4122 (10xx binary)
โ โโโโโโโโ Version: 7 โ UUID v7
โโโโโโโโโโโโโโโโโโโโโโโโ First 48 bits = Unix timestamp (ms)
# Python decoder
import uuid
u = uuid.UUID('550e8400-e29b-41d4-a716-446655440000')
print(u.version) # โ 4
print(u.variant) # โ RFC 4122
print(hex(u.int)) # โ full 128-bit integer
UUID Regex โ Validate UUIDs in Code
Use the following UUID regex patterns in your back-end, API routes, or form validation logic. These cover all versions (v1โv8):
// Any UUID (v1โv8, case-insensitive)
/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
// UUID v4 only
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
// UUID v7 only
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
// JavaScript usage
const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
const isValid = UUID_REGEX.test(input);
// Python usage
import re
UUID_PATTERN = re.compile(
r'^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$',
re.IGNORECASE
)
is_valid = bool(UUID_PATTERN.match(input_string))
Tip: For production systems, always combine regex with version-specific logic. A regex confirms the shape of a UUID; parsing the version and variant bits confirms its type.
Common UUID Use Cases
๐๏ธ
Database Primary Keys
Replace auto-increment integers with UUIDs for better portability across distributed databases. UUID v7 is recommended for index efficiency.
๐
Session & Auth Tokens
UUID v4 is unpredictable enough for session identifiers, password-reset tokens, and email confirmation links.
๐ก
API Request IDs
Attach a UUID to every API request for distributed tracing, idempotency keys, and log correlation across microservices.
๐
File & Asset Naming
Avoid naming collisions when uploading user files to S3 or cloud storage by prefixing filenames with a UUID.
๐๏ธ
Distributed Systems
Nodes in a distributed cluster can generate IDs independently without a central coordinator, eliminating a single point of failure.
๐งช
Test & Mock Data
Generate bulk UUIDs for test fixtures, seed scripts, and mock API responses. Our tool supports up to 1000 at a time.
Frequently Asked Questions
Are generated UUIDs truly unique?
UUIDs are practically unique. UUID v4 has 2122 random bits, giving a collision probability of roughly 1 in 5.3 ร 1036. You would need to generate 1 billion UUIDs per second for 85 years before a 50% chance of a single collision. For all real-world applications, treat UUIDs as unique.
Which UUID version should I use for database primary keys?
Use UUID v7 for new projects. Its embedded timestamp makes UUIDs monotonically increasing, which means new rows land at the end of B-tree index pages โ just like auto-increment integers โ resulting in far fewer page splits and better write performance than random v4 UUIDs. PostgreSQL users can use the pg_uuidv7 extension, or generate v7 UUIDs in application code and pass them in.
Is it safe to generate UUIDs online?
Yes โ this tool generates UUIDs entirely in your browser using the Web Crypto API (crypto.randomUUID()). No data is sent to any server. The UUIDs are generated locally on your device and never logged or stored.
What is the difference between UUID and UUID GUID?
They are functionally identical. GUID is Microsoft's brand name for the same 128-bit identifier standard. A GUID generated by System.Guid.NewGuid() in C# is exactly the same format as a UUID generated by uuid.uuid4() in Python.
How do I validate a UUID online?
Use the UUID Validator built into this page โ paste your UUID string and it will confirm the format, version, and variant instantly. Alternatively, apply the UUID regex pattern shown in the section above to validate UUIDs in your own code.
Can I decode a UUID to find out when it was created?
Only for UUID v1 and UUID v7. Both embed a timestamp in their structure. UUID v4 is fully random โ no timestamp is recoverable. UUID v1 embeds a 60-bit timestamp counted in 100-nanosecond intervals from 15 October 1582. UUID v7 embeds a Unix millisecond timestamp in the most-significant 48 bits, making decoding straightforward.
How do I generate a UUID in PostgreSQL without an extension?
In PostgreSQL 13 and later, gen_random_uuid() is built-in and produces a UUID v4. In earlier versions you needed the pgcrypto extension: CREATE EXTENSION pgcrypto; SELECT gen_random_uuid();. The old uuid-ossp extension's uuid_generate_v4() function also works but is no longer the recommended approach.
Quick Reference โ UUID Generation by Platform
| Platform |
Method / Command |
Version |
| JavaScript (browser/Node) | crypto.randomUUID() | v4 |
| Python | uuid.uuid4() | v4 |
| Java | UUID.randomUUID() | v4 |
| PostgreSQL 13+ | gen_random_uuid() | v4 |
| Linux CLI | uuidgen | v4 / v1 |
| PowerShell | [System.Guid]::NewGuid() | v4 |
| Go | uuid.New() (google/uuid) | v4 |
| PHP | Str::uuid() (Laravel) | v4 |
| C# / .NET | Guid.NewGuid() | v4 |
Generate UUIDs Right Now โ Free & Instant
Use the UUID generator tool at the top of this page to create UUID v4 identifiers instantly. Bulk-generate up to 1,000 UUIDs, copy them to your clipboard, or download as a text file. No sign-up required. All generation happens in your browser โ your IDs never leave your device.