Guide / Formats
Client ID formats compared
Client IDs come in a handful of standard shapes. Each trades off readability, length, guessability and coordination cost. Here are the four you will meet most often, with examples and honest trade-offs.
1. Sequential numbers
1001, 1002, 1003 ...
The classic: an auto-incrementing integer, usually starting at 1000 or 10000 so early IDs do not look tiny. Compact, sortable, easy to read over the phone, and trivially unique within one database.
Downsides: sequential IDs reveal business facts — customer #1042 means you have about a thousand customers — and they are trivially enumerable, so they should never be the only thing protecting a URL or API endpoint.
2. Prefixed codes
CLT-8X4K2Q, CUST-004231, ACME-X7P2M9
A short human-readable prefix plus a numeric or alphanumeric random part. The prefix tells staff which system or record type an ID belongs to at a glance, and the random part avoids the information leakage of pure sequences. Omitting ambiguous characters (I, O, 0, 1) keeps phone readouts painless.
Downsides: longer than plain numbers, and random parts need a uniqueness check against the database to rule out rare collisions.
3. Hex strings
3f9a2c1e, a41f0c9d2b7e
Fixed-length strings of hexadecimal characters. Compact for their entropy and URL-safe by nature. Common as session-adjacent identifiers and in systems that generate IDs in application code rather than the database.
4. UUIDs (version 4)
550e8400-e29b-41d4-a716-446655440000
A 128-bit value written as 32 hex digits in an 8-4-4-4-12 grouping. Version 4 UUIDs are randomly generated, and the space is so large that collisions are practically impossible — no central coordination needed, which is why distributed systems love them.
Downsides: 36 characters of unreadable hex. Nobody reads a UUID over the phone, and they make for ugly URLs. Many systems store a UUID internally while showing staff a shorter prefixed code.
Which format should you pick?
| Need | Best fit |
|---|---|
| Internal database key | Auto-increment integer or UUID — let the database guarantee it |
| Customer-facing reference | Prefixed code — readable, branded, opaque |
| Distributed / offline-first systems | UUID v4 — unique without coordination |
| Short IDs for URLs or SMS | Hex or short alphanumeric — compact and URL-safe |