IDs feel boring until they leak information, sort badly, or become too long for a URL. The format you choose quietly shapes debugging, indexing, copy-paste, and privacy.
Toolcore's Identity tools make it easy to try the common options without installing a package just to generate a few values.
Use UUID when boring and standard is the point
A classic random UUID is a good default when you need an opaque identifier that many databases, APIs, and logs already understand. It is not short, but it is familiar.
Use it for internal records, test fixtures, and examples where the standard 8-4-4-4-12 shape is more useful than compactness.
Use UUID v7 or ULID when order helps
If you want IDs that sort roughly by creation time, try UUID v7 or ULID. They are useful in logs, event streams, and systems where newest-first queries are common.
The tradeoff is that time-ordering says something about when a value was created. That may be fine in an admin log and less fine in a public URL.
Use ObjectId when the ecosystem already expects it
MongoDB-style ObjectId values are 24 hex characters with an embedded timestamp. Use the parser when you need to inspect a value copied from a collection, log, or migration note.
Do not use ObjectId just because it is shorter than a UUID. Use it when the surrounding database or document format already speaks that shape.
Use Nano ID when the identifier needs to be short and URL-safe
Nano ID is useful for compact strings, invite codes, demo data, and URLs where a full UUID feels too heavy. Adjust the alphabet and length to match the context.
Compact does not mean secret by default. If the value grants access, you still need enough entropy and server-side authorization.
Do not confuse identifiers with secrets
IDs identify. Secrets authorize. When you need a password, bearer token, or one-time secret, open the password or random-string tools instead of copying a UUID from a sample.
This difference matters in docs too. Calling an identifier a token can make reviewers assume it must be hidden, or worse, make people treat a real secret as harmless.
A quick decision routine
- Need a standard opaque ID? Use UUID.
- Need time order? Try UUID v7 or ULID, then think about what the timestamp reveals.
- Working with MongoDB? Parse or generate ObjectId values.
- Need a compact URL-safe string? Use Nano ID with an appropriate length.
- Need access control? Do not stop at an ID. Use real authorization.