📚 Developer · Guide

How to Generate UUIDs Online: Version 4 UUIDs Explained

Generate random version-4 UUIDs, one or hundreds at a time. Learn what a UUID is, how unique it really is, when to use one as a database ID and the differences between UUID versions.

By RexBD Team 24 Nov 2026 7 min read 1,511 words
How to Generate UUIDs Online: Version 4 UUIDs Explained

Every record in a system needs an identity. A customer, an order, an uploaded file, a log entry, a device: each one needs an ID that no other record shares. The simplest approach is counting, 1, 2, 3, and many databases do exactly that. But counting has limits. Two servers counting separately will produce the same numbers. IDs in URLs reveal how many records you have. Merging data from different systems causes collisions.

UUIDs solve these problems. A UUID is an identifier so large and random that you can generate it anywhere, on any device, without coordinating with anyone, and still be practically certain it is unique. This guide explains how to use the free UUID Generator on RexBD and everything you need to know to use UUIDs well.

What a UUID is

UUID stands for Universally Unique Identifier. Microsoft calls the same thing a GUID (Globally Unique Identifier). It is a 128-bit number, usually written as 32 hexadecimal digits in five groups separated by hyphens:

f47ac10b-58cc-4372-a567-0e02b2c3d479

The groups have 8, 4, 4, 4 and 12 characters, making 36 characters in total including hyphens. The format is defined in RFC 9562 (which updated the older RFC 4122).

Hidden in the layout are two small markers:

  • The first digit of the third group is the version. In a version 4 UUID it is always 4.
  • The first digit of the fourth group is the variant, usually 8, 9, a or b for standard UUIDs.

So every v4 UUID has the shape xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx.

🆔 Free tool · no sign-upTry the UUID GeneratorGenerate random version-4 UUIDs, one or hundreds at a time. Open tool →

How to use the UUID Generator

Step 1: Choose how many

Open the UUID Generator and choose how many UUIDs you need. You can generate one, or hundreds at once for test data or bulk imports.

Step 2: Generate

The tool creates random version 4 UUIDs using your browser's secure random number generator (the Web Crypto API), the same source of randomness used for cryptographic purposes.

Step 3: Copy

Copy a single UUID or the whole list, one per line, ready to paste into code, a spreadsheet, a SQL script or a configuration file.

Because generation happens in your browser, nothing is logged or stored on a server.

How unique is a random UUID?

A version 4 UUID has 122 random bits. That gives about 5.3 × 10^36 possible values, a number so large that everyday intuition does not help.

A common way to picture it: you would need to generate roughly 2.7 quintillion (2.7 × 10^18) UUIDs before there was even a 50% chance of a single duplicate. Generating a billion UUIDs every second, that would take around 85 years.

In practice, the risk of a collision is far smaller than the risk of hardware failure or a software bug. That is why systems all over the world generate UUIDs independently and trust them to be unique. The important condition is good randomness. UUIDs generated with a weak random source can collide, which is why the RexBD tool uses the browser's cryptographically secure generator.

Ad Kothay

UUID versions at a glance

Version How it is made Typical use
v1 Timestamp plus device (MAC) address Older systems; can reveal when and where it was made
v3 MD5 hash of a namespace and name Same input always gives the same UUID
v4 Random The most common general-purpose choice
v5 SHA-1 hash of a namespace and name Like v3, with a stronger hash
v6 Reordered timestamp (newer) Time-sortable variant of v1
v7 Unix timestamp plus random bits (newer) Time-sortable IDs for databases

Version 4 is the safe default for most needs. Version 7 is increasingly popular for database primary keys, because new IDs sort in creation order, which keeps database indexes efficient.

When to use UUIDs

UUIDs are a good choice when:

  • Several systems create records independently, such as mobile apps working offline that sync later, or multiple servers writing to their own databases.
  • You merge data from different sources. Numbered IDs would collide; UUIDs will not.
  • IDs appear in URLs or APIs. Sequential IDs such as /invoice/1043 let anyone guess /invoice/1044. A UUID cannot be guessed. (This is not a substitute for proper access checks, but it avoids leaking information such as how many orders you have.)
  • You need an ID before saving to the database, for example to reference a new object in several places within one operation.
  • You need unique file names for uploads, so two files called "photo.jpg" do not overwrite each other.
  • You need unique keys for events, messages or requests, such as an idempotency key that stops a payment from being processed twice.

When simple numbers might be better

UUIDs are not always the best choice:

  • Storage and speed. A UUID takes 16 bytes as binary, or 36 characters as text, compared with 4 or 8 bytes for an integer. Random v4 UUIDs as primary keys can also slow down inserts in large tables, because new values land in random places in the index. Time-ordered UUIDs (v7) or storing UUIDs as binary help.
  • Human use. Customers cannot read a UUID over the phone. For invoice numbers, order numbers and ticket numbers that people say out loud, a short, readable code is better. Many systems use both: a UUID internally and a friendly number for people.
  • Small, single-database apps often do perfectly well with auto-increment numbers.

A worked example: seeding a test database

A developer is building a delivery app and needs realistic test data: 50 customers, each with an ID, name and phone number. The database uses UUIDs as primary keys.

She opens the UUID Generator, sets the count to 50 and copies the list. She then uses the Fake Data Generator to create 50 realistic names and phone numbers, pastes both into a spreadsheet side by side, and turns the rows into INSERT statements with the CSV to SQL converter. In a few minutes, she has a complete, repeatable test dataset, and because the UUIDs are fixed in the script, every test run uses the same IDs, which makes bugs easier to reproduce.

Storing UUIDs in databases

  • PostgreSQL has a native uuid type. Use it rather than text.
  • MySQL and MariaDB can store UUIDs as CHAR(36) for simplicity or BINARY(16) for efficiency. MySQL provides functions such as UUID_TO_BIN() to convert.
  • SQL Server has uniqueidentifier.
  • MongoDB uses its own ObjectId by default but supports UUIDs.

Whatever you choose, be consistent about lowercase versus uppercase in text form. UUIDs are case-insensitive by definition, but string comparisons in code may not be. Lowercase is the convention.

Common mistakes

  • Using Math.random() to make UUIDs. It is not cryptographically secure and can produce collisions at scale. Use crypto.randomUUID() in modern browsers and Node.js, or a proper library.
  • Treating UUIDs as secrets. A UUID is hard to guess but it is not a password. Do not use one as the only protection for private data.
  • Mixing formats. Storing some IDs with hyphens and some without, or some uppercase, causes failed lookups.
  • Using v1 UUIDs carelessly. They can expose the time and the machine's network address.

Generating UUIDs in code

Most languages can create v4 UUIDs directly:

  • JavaScript (browser and Node.js): crypto.randomUUID()
  • Python: import uuid; uuid.uuid4()
  • PHP: Str::uuid() in Laravel, or the ramsey/uuid library
  • Java: UUID.randomUUID()
  • C#: Guid.NewGuid()

The online generator is handy when you need IDs outside code: in spreadsheets, documentation, API testing tools, configuration files or quick manual tests.

Our practical uses of a UUID generator article looks at more scenarios.

Frequently asked questions

What is the difference between a UUID and a GUID?

They are the same thing. GUID is the name Microsoft uses.

Can two UUIDs ever be the same?

In theory yes, but for properly generated random v4 UUIDs the chance is so small it can be ignored in practice.

Are UUIDs case-sensitive?

No. By definition they are not, but use lowercase consistently to avoid string comparison issues.

Which UUID version should I use?

Version 4 for general use. Consider version 7 for database primary keys if your tools support it.

Is it safe to generate UUIDs online?

With RexBD, yes. The UUIDs are generated in your browser with secure randomness and are not sent anywhere.

Should I show UUIDs to customers?

Usually not as their main reference number. UUIDs are long and hard to read aloud or type. Show customers a short, friendly code, such as an order number, and keep the UUID for internal links, APIs and database relationships.

Can I remove the hyphens from a UUID?

Yes. The hyphens are only for readability. A UUID without hyphens is 32 hexadecimal characters and represents the same value. Just be consistent across your system, because many libraries expect the standard hyphenated form when parsing.

Is the UUID Generator free?

Yes. It is free and needs no account.

Found this useful?Share it with a friend or colleague who needs it.

Keep reading

More developer articles
321 free tools, one placeSEO, text, images, code, money, units and design. Private, fast and almost all in your browser.
Ad Kothay