Skip to content

What Is a UUID? Unique IDs for Orders, Customers, and URLs Explained

Java logo above the question What Is UUID in Java?

Look at the address bar after placing an order online or opening a shared document, and you may see a long string such as 3f2b9c1e-8a4d-4c7f-9e21-5b6a0d3c8f17. That is a UUID, a universally unique identifier. Developers use UUIDs to label records so that no two are ever the same, even when they are created on different servers at the same moment.

This guide explains UUIDs for business owners and managers. It covers what they are, how Java creates them, the main versions, when they beat simple numbered IDs, the privacy and security points to understand, and the trade-offs your developer may mention.

What a UUID is

A UUID is a 128-bit number, usually written as 32 hexadecimal characters in five groups separated by hyphens. The format is defined in an internet standard, RFC 9562, published in 2024 to replace the older RFC 4122. Microsoft systems often call the same thing a GUID, a globally unique identifier.

The point of a UUID is that it can be generated anywhere, by any server or device, without checking a central list, with a negligible chance of ever producing the same value twice. That makes UUIDs useful in systems that create records in many places at once, such as apps that work offline, multiple servers behind one website, or data merged from several sources.

How Java creates UUIDs

Java includes UUID support in its standard library. The line UUID id = UUID.randomUUID(); creates a random UUID, known as version 4, using a cryptographically strong random number generator. Java can also create name-based UUIDs from a piece of text, which always produce the same UUID for the same input, and can read UUIDs from text with UUID.fromString.

Other languages and databases offer the same features. PostgreSQL, for example, has a dedicated UUID column type, and many frameworks create UUIDs for new records automatically. Our guide to what Java is and what it is used for covers where Java fits in a typical project.

Sequential IDs1041, 1042, 1043Short, easy to read aloudReveal order volumeEasy to guess the next oneUUIDs3f2b9c1e-8a4d-4c7f-...Created anywhere, no clashesReveal nothing about volumeLong, hard to read aloudEither way, the server checks who may see the record
Many systems use both: a UUID internally and a short reference for customers.

The main UUID versions

Several versions exist, identified by one character in the string. Version 4 is random and the most widely used. Version 1 is based on a timestamp and, in its original form, the network address of the computer that made it, which raised privacy concerns. Versions 3 and 5 are generated from a name. Version 7, added in RFC 9562, combines a timestamp with random bits, so new UUIDs sort roughly in creation order.

That last property matters for databases. Random version 4 UUIDs scatter new records throughout a database index, which can slow inserts in very large tables. Time-ordered version 7 UUIDs keep the benefits of uniqueness while inserting more efficiently, which is why many developers now prefer them for new projects.

When UUIDs beat numbered IDs

Simple numbered IDs, such as order 1041, 1042, and 1043, are short and easy to say on the phone, but they reveal information. A competitor who places two orders a week apart can work out roughly how many orders you take. Numbered customer or invoice IDs in URLs also invite people to try the next number.

UUIDs avoid both problems and make it easy to merge data from different systems without clashes. Many businesses therefore use a UUID internally and show customers a separate, friendly reference, such as a short order code.

Unguessable is not the same as secure

A UUID in a link is hard to guess, but it is not a password. Links get forwarded, saved in browser histories, and pasted into chats. A website must still check that the logged-in user is allowed to see each order, invoice, or file, whatever the ID looks like. When that check is missing and users can see other people's records by changing an ID, security specialists call it an insecure direct object reference, a common and serious flaw.

For links that must work without logging in, such as a password reset or a shared document, use purpose-built tokens that expire, rather than a permanent record ID. Our guide to tokens in web development explains the difference.

UUIDs in URLs and SEO

UUIDs are fine in private URLs, such as order pages or account areas, which search engines should not index anyway. For public pages that you want to rank, such as products, articles, and categories, readable URLs with words are better for visitors and clearer in search results. Our guide to search engine optimization covers URL basics.

Questions to ask your developer

Ask which records use UUIDs and which use numbers, and why. Ask which version they use and whether it affects database performance at your expected size. Ask how the system checks access to each record, regardless of the ID, and whether customers see a friendly reference or the full UUID. Clear answers show a team that has thought about both usability and security.

Moving data between systems

UUIDs are especially useful when data moves between systems. If your store, CRM, and accounting software each number customers from one, the same number means different people in each system, and merging them is error-prone. A shared UUID for each customer or order makes it clear which records belong together. When you plan a new integration or a migration, ask which identifier links the records across systems and where it is stored.

None of this needs to be visible to customers. A well-designed system can use UUIDs everywhere behind the scenes and still show friendly order numbers on receipts, emails, and support calls, so customers and staff never have to read a 36-character code aloud.

Unique, but not a lock

A UUID is a 128-bit identifier that can be created anywhere without clashes, generated in Java with UUID.randomUUID() and in most other languages and databases with similar tools. UUIDs hide order volumes and make data easy to merge, and time-ordered version 7 suits large databases. They do not replace proper access checks on every record.

If you are planning a customer portal or online store, our web development team can help design IDs, URLs, and access rules together, and our guide to must-have website features covers the wider brief.

Want this checked on your own site?

Check one URL in Swiss Knife SEO without an account. A free account supports crawls of up to 100 URLs.