If you've ever peeked at a database, an API response, or a URL that looked like gibberish, you've probably seen a UUID. They look like this: 550e8400-e29b-41d4-a716-446655440000. Here's what they are and why software can't live without them.
What Is a UUID?
UUID stands for Universally Unique Identifier. It's a 128-bit number, usually written as 32 hexadecimal characters with hyphens, like the example above. The word "universally unique" is doing a lot of work โ a properly generated UUID is so unlikely to collide with another that it's treated as effectively unique across all of space and time.
Microsoft's version is called a GUID (Globally Unique Identifier) โ same concept, different name.
Why Not Just Use Sequential Numbers?
Databases have used simple auto-incrementing IDs (1, 2, 3...) for decades, and they work fine โ until you need to combine data from multiple systems. The problem: two different databases can both have a record with ID "1" that means completely different things. UUIDs solve this because they can be generated independently anywhere โ on any server, in any browser, on any device โ and they'll still be unique.
Where You'll Find UUIDs in the Wild
- Database primary keys โ modern databases use UUIDs instead of sequential IDs
- API resources โ REST APIs identify objects with UUIDs
- User sessions โ session tokens and auth cookies
- File names โ uploads renamed to avoid collisions
- Tracking IDs โ orders, support tickets, analytics events
- Distributed systems โ microservices generating IDs independently
UUID Versions: The Important Ones
- UUID v4 โ completely random. The most common type. What most generators produce. Used for the vast majority of purposes.
- UUID v1 โ based on timestamp and machine MAC address. Sortable by creation time, but leaks information about when/where it was created.
- UUID v7 โ time-ordered, designed to be sortable and index-friendly. Gaining popularity in databases.
For almost any general use, UUID v4 is the right choice โ it's simple, random, and secure.
What's a GUID vs. UUID?
They're the same thing. GUID is Microsoft's terminology, UUID is the open standard (RFC 4122). The format is identical. Don't let the different names confuse you.
When Do You Need to Generate a UUID?
- You're building an app and need unique IDs for records
- You need a unique file name for an upload
- You want a unique token for a link or invitation
- You're testing API calls and need a valid ID format
Generate a UUID instantly with the free UUID generator โ