UUID v4 vs UUID v7 — which should you use?
UUID v4 is the default for most use cases — fully random 128-bit identifier, essentially zero collision risk. UUID v7 (2024) adds time-ordering: the first 48 bits are a millisecond-precision Unix timestamp.
| UUID v4 | UUID v7 | |
|---|---|---|
| Entropy | 122 bits random | 74 bits random + 48 bits timestamp |
| Sortable by creation time | No (random) | Yes |
| Database B-tree insert performance | Poor (random inserts fragment the index) | Excellent (append-only behavior) |
| Leaks info | None | Creation timestamp |
| Use for DB primary keys | OK on small tables | Preferred on large tables |
| Use for session tokens / secrets | Yes — no info leak | No — leaks timing |
Rule of thumb: use v7 for database primary keys and IDs you'll sort by time; use v4 for anything user-facing or secret-adjacent (session tokens, API request IDs, reset tokens).
Generate a UUID in every major language
Native or standard-library UUID generators in common dev languages:
// JavaScript / TypeScript (browser + Node 14.17+)
crypto.randomUUID()
// "f47ac10b-58cc-4372-a567-0e02b2c3d479"
# Python 3
import uuid
str(uuid.uuid4())
# UUID v7 needs `uuid-utils` or `uuid7` library
// Java
java.util.UUID.randomUUID().toString();
// C# / .NET
System.Guid.NewGuid().ToString();
// Go
import "github.com/google/uuid"
uuid.NewString() // v4
uuid.NewV7().String() // requires google/uuid v1.6+
// Rust
use uuid::Uuid;
Uuid::new_v4().to_string();
// Kotlin
java.util.UUID.randomUUID().toString()
// Swift
UUID().uuidString
All of these use cryptographically secure random generators (/dev/urandom or OS CSPRNG) — no need to worry about predictability. The odds of two UUID v4s colliding across a billion calls is roughly 1 in 1018.
UUID in Minecraft — player lookup explained
Minecraft assigns every player a UUID derived from their Microsoft/Mojang account. The UUID persists even if the player changes their display name — servers use it for bans, permissions, and inventory storage.
Format in Minecraft:
- Trimmed:
069a79f444e94726a5befca90e38aaf5(no hyphens, lowercase). This is the format stored in NBT files. - Dashed:
069a79f4-44e9-4726-a5be-fca90e38aaf5(with hyphens). Used in JSON APIs and URLs.
Lookup APIs:
# Player name → UUID
curl https://api.mojang.com/users/profiles/minecraft/<playername>
# → {"id":"069a79f444e94726a5befca90e38aaf5","name":"Notch"}
# UUID → name history
curl https://sessionserver.mojang.com/session/minecraft/profile/<uuid>
Minecraft UUIDs are valid RFC 4122 UUID v3 (name-based, MD5-hashed) — generated from the account's username at creation time.
Frequently Asked Questions
How do I generate a UUID (or GUID) online?
Click Generate and the tool produces a cryptographically-random UUID v4 (for example, `f47ac10b-58cc-4372-a567-0e02b2c3d479`). Use Bulk Generate to create 10, 100 or 1000 UUIDs at once — perfect for seeding test data.
What's the difference between UUID v4, v1 and v7?
UUID v4 is fully random (most common). UUID v1 encodes timestamp + MAC address (leaks host info). UUID v7 is time-ordered (sortable by creation time, better for database primary keys). Our generator supports v1, v4 and v7 — pick by use case.
Is a GUID the same as a UUID?
Yes. GUID (Globally Unique Identifier) is Microsoft's name for UUID (Universally Unique Identifier). They're the same 128-bit format, same generation algorithm — the terms are interchangeable across Windows, .NET, Java, Python and JavaScript.
Are the UUIDs generated here unique and safe for production?
Yes. UUID v4 uses `crypto.getRandomValues()` from the Web Crypto API — cryptographically strong randomness. The chance of collision in a billion UUIDs is roughly 1 in 10^18. Safe for database primary keys, session IDs, API request IDs.
How do I generate a UUID v4 in JavaScript, Python or C#?
JavaScript: `crypto.randomUUID()`. Python: `uuid.uuid4()`. C#: `Guid.NewGuid()`. Go: `uuid.NewRandom()`. Our tool uses the same `crypto.randomUUID()` under the hood — it's a reference implementation in the browser.
Related Developer Tools
Copyright © 2026 BuildStudio. All rights reserved.
Designed and Developed by Webority Technologies
Report an issue
We use necessary cookies to run this site, and analytics cookies only with your consent. No advertising, no cross-site tracking. Read our Privacy Policy.