Generate a UUID: What It Is, How to Make One, Why It Works
To generate a UUID, open GrabCast's UUID Generator, leave Count at 1 and click Generate: you get a random version 4 identifier such as 3f2b8c1e-9a4d-4c7b-b1e2-5d6f7a8b9c0d, created in your browser by the crypto.randomUUID function and ready to copy. In code it is usually one line, for example uuid.uuid4() in Python or crypto.randomUUID() in JavaScript. This explainer is for people meeting UUIDs for the first time, whether a junior developer, a QA tester filling in a form field or an analyst who keeps seeing these strings in exports. It covers how to read the 36 characters, why a value made on your laptop will not clash with one made on a server in another country, where UUIDs are the right label, and the handful of situations where a plain counter or a short code serves people better.
๐ Try the UUID Generator tool now โ freeOpen โ
Before UUIDs, most systems numbered records with a shared counter: order 1001, order 1002 and so on. That works until two servers, two offline phones or two merged databases each hand out order 1002. Coordinating one counter across machines is slow and fragile. A UUID removes the coordination entirely. It is 128 bits long, and a version 4 value fills 122 of those bits with random data, so any device can create an identifier on its own and trust that nobody else will ever produce the same one. That independence is why UUIDs label database rows, uploaded files, API requests, Bluetooth services and software packages all over the world.
How to read the 36 characters of a UUID
Every standard UUID is written as 32 hexadecimal digits in five hyphen-separated groups of 8, 4, 4, 4 and 12 characters, 36 characters in total. Only the digits 0 to 9 and the letters a to f appear, and upper and lower case mean the same thing, although lowercase is the recommended output.
- The first digit of the third group is the version. In 3f2b8c1e-9a4d-4c7b-b1e2-5d6f7a8b9c0d it is 4, meaning random.
- The first digit of the fourth group is the variant. For standard UUIDs it is always 8, 9, a or b; here it is b.
- Everything else in a version 4 value is random, so it carries no hidden date, user or machine information.
- Two special values exist: the nil UUID of all zeros, often used as a placeholder, and the max UUID of all f characters.
Other versions fill the remaining bits differently. Version 1 mixes a timestamp with a hardware address, versions 3 and 5 are hashes of a name, and version 7, added in RFC 9562 in 2024, starts with a millisecond timestamp. Version 4 remains the most widely used.
Why two random UUIDs practically never collide
A version 4 UUID has 2 to the power of 122 possible values, about 5.3 undecillion. Uniqueness is not guaranteed by any central registry; it is guaranteed by that size.
- You would need roughly 2.7 quintillion random UUIDs before the chance of even one duplicate reached 50 percent.
- Generating a billion every second, that point would take around 86 years.
- For a table of 100 million rows the odds of any collision are far smaller than the odds of a disk error corrupting the data.
- The math only holds with a good random source. The GrabCast tool and modern libraries use a cryptographically secure generator; homemade code built on Math.random does not qualify.
Careful teams still add a unique constraint to the column. It costs little and turns an impossible-but-catastrophic event, or more realistically a bug that reuses a value, into an ordinary error.
Ways to generate a UUID in a browser, code or terminal
The browser tool is quickest when you need a value to paste into a form, a config file or a test. Set Count anywhere from 1 to 100, click Generate and click Copy; values come out lowercase, one per line, and nothing is sent to a server. Clicking Generate again always produces fresh values.
- Python: import uuid, then uuid.uuid4().
- JavaScript: crypto.randomUUID() in current browsers and in Node.js; it only works on HTTPS pages or localhost.
- Java: UUID.randomUUID(); C# and PowerShell: Guid.NewGuid() or New-Guid.
- PostgreSQL 13 and later: SELECT gen_random_uuid(); SQL Server: SELECT NEWID(). MySQL's UUID() function returns version 1, not version 4.
- Terminal: uuidgen on macOS and most Linux systems. The macOS version prints uppercase letters, which is valid but worth normalizing.
Where UUIDs fit and where they do not
UUIDs shine wherever independent parts of a system must name things without asking each other first: records created on an offline mobile app and synced later, files in cloud storage, correlation IDs that follow one request through ten services, and idempotency keys that stop a payment from being charged twice when a client retries.
- Poor fit for anything a person reads aloud or types. Nobody wants to quote a 36-character order number to a support agent; use a short code such as A7K-29Q for that.
- Not a password or secret. RFC 9562 warns against using UUIDs as security capabilities, so pair them with real authorization checks.
- Larger than integers: 16 bytes in a native column versus 4 or 8, and 36 bytes or more if stored as text.
- Random order: version 4 values do not sort by creation time, so sort by a timestamp column instead.
A UUID is an identifier, not a secret, so use the Password Generator for anything that must stay private. For a fingerprint of content rather than a random ID, try the Hash Generator.
Step-by-step



Common mistakes to avoid
Pro tips
Frequently asked questions
What does UUID stand for?
Universally unique identifier. It is a 128-bit value defined by RFC 4122 and its 2024 successor RFC 9562, written as 32 hex digits in an 8-4-4-4-12 pattern.
Is a UUID the same as a GUID?
Yes. GUID, or globally unique identifier, is the name used in Microsoft products for the same 128-bit format.
Can I tell when a UUID was created?
Not from version 4, which is random apart from the version and variant digits. Versions 1 and 7 do contain a timestamp.
Is the online generator safe to use?
Yes. The GrabCast tool creates values locally with the browser's secure crypto.randomUUID function and does not send or store them, so only you see them.
How many UUIDs can I generate at once?
Up to 100 per click, one per line. Click Generate again for another batch; each batch is new.
A UUID is a 36-character, 128-bit label that any device can create without checking with anyone else, and a random version 4 value is unique for every practical purpose. Generate one in the browser tool or with one line of code, read the version digit to know what you have, and keep UUIDs for machines rather than for people.
Related guides
Browse more: all text and developer guides ยท the UUID Generator tool