UUID Generator — Random v4 & Deterministic v5 from Text or File
About the UUID Generator
A UUID (universally unique identifier) is a 128-bit ID like 3f8a2c1e-9b4d-4e6a-8f2b-1c9d8e7f6a5b. Version 4 UUIDs are random: 122 random bits make collisions astronomically unlikely, so they work as database keys, request IDs or object names without any coordination.
Version 5 UUIDs solve the opposite problem: you need the same input to always produce the same ID. Feed the tool any text (a username, URL, order number) or any file — it derives a stable v5 UUID from the content, using SHA-1 and a namespace per RFC 4122. Rename a file and its UUID stays the same; change one byte inside and it changes completely. That makes v5 ideal for deduplication, cache keys and reproducible identifiers.
How to use the UUID Generator
- Random (v4): choose how many you need and click Generate — then pick lowercase, uppercase, braces or hyphen-free format.
- From text (v5): pick a namespace (DNS, URL, OID, X.500 or your own UUID), type the text, and generate — the same pair always yields the same UUID.
- From file (v5): drop any file; its content hash decides the UUID, so identical files get identical IDs anywhere.
How unique is a UUID v4?
122 random bits ≈ 5.3 × 10³⁶ possible values. Generating a billion UUIDs per second for 80 years would still leave the chance of a single collision far below one in a billion. v5 is deterministic: UUID = SHA-1(namespace ‖ name), with version and variant bits overwritten. File UUIDs use name = sha256:<content hash>.
Frequently asked questions
What is the difference between UUID v4 and v5?
v4 is random — every click gives a new ID. v5 is derived (SHA-1) from a namespace plus a name — the same input always reproduces the same UUID, which is what you want for stable, reproducible identifiers.
What can I use a v5 UUID from a file for?
Deduplication is the classic case: two folders with the same photo, PDF or backup get the same UUID regardless of filename, so you can detect duplicates by ID comparison instead of full content scans.
Are these UUIDs safe to use as secrets or tokens?
They are unpredictable and fine as identifiers, but for security tokens prefer longer, purpose-built randomness — see our Password Generator for that job.
Does the file UUID change if I rename the file?
No. The UUID is derived only from the file's content (SHA-256 hash), not its name, size or location. Editing the content, however, produces a completely different UUID.
Related tools
Hash Generator
A hash function turns any input into a fixed-length fingerprint that is easy to compute and practically impossible to reverse.
Password Generator
This generator creates passwords from cryptographically secure randomness — the browser's crypto.getRandomValues, the same…
JSON Formatter
Paste JSON and this tool tells you instantly whether it is valid — and if not, exactly where it breaks, with the error position.