OneFreePlace / Your free workspaceBuilt by people, for people.
A ONEFREEPLACE GUIDE

When should you use a UUID instead of a running number?

Understand random version 4 identifiers, their strengths, and why they are not passwords.

A running number is easy to read, but a central counter can be awkward when several systems create records independently. A random UUID lets those systems generate identifiers without asking one shared counter for the next number.

Recognize version 4

A UUID v4 is a 128-bit identifier with a standard text shape: eight hexadecimal characters, then groups of four, four, four, and twelve. The version digit in the third group is 4. The UUID generator calls the browser’s cryptographic random source to create new IDs and can produce a short list for test data or a project.

A random UUID has a very large space of possible values. Collisions are extremely unlikely in ordinary use, but “unlikely” is not “mathematically impossible.” A system that needs strict uniqueness should still enforce a unique constraint in its database.

Use the right kind of secret

UUIDs are labels, not passwords or access tokens. Their format is public, and exposing one in a link should not grant access by itself. Apply normal authentication and authorization to a record even if its identifier is difficult to guess.

Copy and store carefully

Keep the exact hyphens and characters when a destination expects the standard representation. The tool creates the IDs locally and does not upload them. If you need sortable identifiers, a UUID v4 is randomized rather than chronological; choose a different identifier design for that requirement.

← All guides