How to Generate a UUID (v4, v7 and Which One to Use)
Generate UUIDs and GUIDs online: random v4, time-ordered v7 and more. Learn what the 36 characters mean, how unlikely a collision is, and which format to pick.
Updated November 4, 20268 min read
To generate a UUID, open the UUID generator, leave the version on v4 random, choose how many you want and press the generate button. You get values like 550e8400-e29b-41d4-a716-446655440000, ready to copy. A UUID, also called a GUID on Windows and in SQL Server, is a 128-bit label that you can make on any device without asking a central server, and that is so unlikely to repeat that you can treat it as unique. This guide explains what the 36 characters mean, which version to choose, how safe the uniqueness really is, and how to get the format your database or code expects.
What a UUID is and why people use it
UUID stands for universally unique identifier. It is a way to name a record, a file, an order or a user without a counter. A counter needs one place that hands out the next number, and that place becomes a bottleneck or a point of failure. With UUIDs, every phone, server and script can invent its own identifiers at the same time and nobody has to coordinate.
GUID means the same thing. Microsoft used the word first and it is still the name in .NET, SQL Server and the Windows registry. In practice a GUID and a UUID are the same 128 bits, and the only visible difference is sometimes the capital letters or curly braces around it.
The anatomy of the 36 characters
Take 550e8400-e29b-41d4-a716-446655440000. It is 32 hexadecimal digits (0 to 9 and a to f) plus four hyphens, which makes 36 characters. The hyphens are only for reading. The real value is the 32 digits, which is 128 bits or 16 bytes. The groups are always 8, 4, 4, 4 and 12 digits long.
| Group | Length | What it holds |
|---|---|---|
| 550e8400 | 8 digits | In v7 the first part of the timestamp; in v4 random bits |
| e29b | 4 digits | More timestamp (v7) or random bits (v4) |
| 41d4 | 4 digits | Starts with the version digit: the 4 here means version 4 |
| a716 | 4 digits | Starts with the variant bits; an 8, 9, a or b means the standard layout |
| 446655440000 | 12 digits | Mostly random in v4 and v7 |
Two details are worth remembering. The first digit of the third group is the version, so you can tell a v4 from a v7 by eye. The first digit of the fourth group is always 8, 9, a or b in a standard identifier. If you see something else there, the value is not a standard RFC UUID, even if it looks like one. Microsoft COM GUIDs are the usual example. The tool's Check mode reports this as non-standard rather than invalid.
How to generate UUIDs, step by step
Open the generator and pick a version
In the UUID generator the Mode is Generate by default. Under Version choose v4 random for a plain identifier, or v7 time-ordered if the value will be a database key.
Set how many
Type a number under How many or use a preset. Free gives you up to 100 per click, which covers test data and a handful of keys.
Choose how they look
Switch Letter case to UPPERCASE, turn off Keep the hyphens for the 32-character compact form, or set the Wrapper to {braces} or urn:uuid:. These only change the display, so nothing is regenerated.
Generate and copy
Press the generate button, then Copy next to one value or Copy all for the whole batch. Everything is made on your device, not on our servers.
Export if you need a file
Under Export format pick One per line, Comma separated, JSON array, CSV or Base64 and download the list.
Make v4, v7 and six more kinds, in any format. Free: 100 UUIDs per click, with every version, format and export type included. Pro: up to a million at a time. It all runs on your device, not our servers.
Generate UUIDsWhich version should you pick?
The tool offers eight kinds. Most people need only the first two.
| Kind | What it contains | Use it when |
|---|---|---|
| v4 random | 122 random bits | You just need a unique id and have no other rule |
| v7 time-ordered | A millisecond timestamp, then random bits | The id will be a database primary key or you want it to sort by creation |
| v1 time-based | A timestamp, clock sequence and node | An older system already expects v1 |
| v6 sortable | The v1 fields in sortable order | You must keep v1 style data but need sorting |
| v3 name (MD5) | A hash of a namespace and a name | You need the same id every time for the same name; kept for compatibility |
| v5 name (SHA-1) | The same idea with SHA-1 | The same, for new work |
| Nil and Max | All zeros, all f | A placeholder for no value, or an upper bound |
For a database, v7 is usually the better choice than v4. A v7 value starts with the time, so new rows land at the end of the index. Random v4 keys land anywhere, which makes a large table do more work on every insert. If you only label things and never sort by the id, v4 is fine and simpler. Version 2 and version 8 are not generated by this tool.
Versions 3 and 5 work differently: you paste a list of names, one per line, pick a namespace such as DNS or URL, and each name always produces the same identifier. That is useful for reconciling records between systems that never share a database. The count comes from your list, and the free limit of 100 applies to it as well.
How likely is a collision?
A v4 UUID has 122 random bits, which is about 5.3 followed by 36 zeros possible values. Numbers that big do not feel real, so here are two comparisons. To have a one-in-a-billion chance of even one repeated value, you would have to generate roughly 100 trillion UUIDs. To reach a 50 percent chance you would need about 2.7 quintillion, which at a billion per second takes more than eight decades of nonstop work.
A v7 value keeps 74 random bits per value because the rest is taken by the timestamp and the version. That is far smaller than 122 but still beyond any realistic risk, particularly because two v7 values made in different milliseconds can never match. Versions 3 and 5 are meant to repeat for the same input, so a match there is the feature, not a fault.
In practice a collision almost never comes from the maths. It comes from a weak random source, from copying the same value by accident, or from two systems normalising the case differently. The tool draws from the device's cryptographic random generator, not a simple pseudo-random function.
Formats: uppercase, no hyphens, braces
The standard form is lowercase with hyphens, and software should compare UUIDs without caring about case. Systems still differ in how they write them, so the tool lets you match the target exactly. These settings are free on every version.
| Setting | Example result | Typical place |
|---|---|---|
| Plain, lowercase | 550e8400-e29b-41d4-a716-446655440000 | Most APIs, JSON and databases |
| UPPERCASE | 550E8400-E29B-41D4-A716-446655440000 | Windows tools and some older documents |
| Keep the hyphens off | 550e8400e29b41d4a716446655440000 | Compact 32-character columns and file names |
| {braces} | {550e8400-e29b-41d4-a716-446655440000} | SQL Server and Windows GUID notation |
| urn:uuid: | urn:uuid:550e8400-e29b-41d4-a716-446655440000 | Places that want the URI form |
If two of your systems store the same id in different forms, a plain text comparison will say they are different. Pick one form at the boundary and convert on the way in. If an id must travel as text inside a URL or a message, see what Base64 encoding is for the other common way to turn data into safe characters.
Bulk lists and checking ids you already have
Free generates up to 100 identifiers per click, and you can press again as often as you like. Pro raises one batch to as many as a million. Only the first 200 values are drawn on the page, so a large batch stays fast, but Copy all and the download always include every value.
Switch the Mode to Check to inspect values you already have. Paste a column, a log excerpt or a JSON body, or drop in a .txt, .csv, .json, .log, .tsv or .ndjson file of up to 10 MB. Each value is reported with its version, its variant and its format. For v1, v6 and v7 the creation time is decoded as well, which is a quick way to learn when a record was made if nobody stored a date. Duplicates in the list are counted, and you can download the report as CSV. To clean a list of repeated lines, use the text deduplicator.
What a UUID is not
A UUID is an identifier, not a password. It ends up in web addresses, logs and error reports, and v1, v6 and v7 even say when they were created. Always check that the person asking for a record is allowed to see it. Do not rely on the id being hard to guess.
Versions 3 and 5 are built on MD5 and SHA-1, which are not safe as security hashes. They are fine for naming and not for protecting anything. If you want a fingerprint of a file or a piece of text, use the hash generator instead. A UUID also takes more space than a small integer: 16 bytes in a native column, 36 as text. Store it in a native UUID or binary column where your database supports one.
Frequently asked questions
How do I generate a UUID online?
Open the UUID generator, keep the version on v4 random, set How many and press the generate button. Copy one value or the whole batch. Free covers up to 100 per click and it runs on your device.
What is the difference between a UUID and a GUID?
Nothing important. GUID is Microsoft's name for the same 128-bit identifier. The usual visible difference is that GUIDs are often written in uppercase or inside curly braces, both of which the tool can produce.
Should I use UUID v4 or v7?
Use v4 when you only need a unique label. Use v7 for database primary keys, because its values start with the time and sort in creation order, which keeps inserts at the end of the index.
Can two UUIDs be the same?
In theory yes, in practice almost never. With v4 you would need about 100 trillion values to reach a one-in-a-billion chance of one repeat. Real problems come from weak random sources or from copying a value twice.
How do I make a UUID without hyphens or in uppercase?
Turn off Keep the hyphens for the 32-character compact form, and switch Letter case to UPPERCASE. You can also wrap values in {braces} or urn:uuid:. These only change how the value is shown.
Can I use a UUID as a password or secret token?
No. A UUID is an identifier. It appears in links and logs, and some versions contain the creation time. Check permissions on every request instead of relying on a hard-to-guess id.