Numbers
UUID With Custom Prefix Generator
Used by developers, writers, and creators worldwide.
A UUID with custom prefix generator creates namespaced identifiers that instantly signal entity type — think user_550e8400-e29b-41d4-a716 or order_f47ac10b. Platforms like Stripe (ch_, cus_, pi_), Clerk (user_, org_), and PlanetScale popularized this pattern because a raw UUID in a stack trace tells you nothing, but invoice_ tells you exactly what broke. This tool generates valid UUIDv4 values paired with any prefix you define. Control the separator between prefix and UUID — underscore, dash, dot, or none — and optionally strip dashes from the UUID itself for shorter, URL-safe strings. Generate up to a large batch at once for seed scripts, fixture files, or ID validation testing.
Loading usage…
Free forever — no account required
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Enter your desired prefix in the Prefix field — use short lowercase labels like order_ or sess_ followed by an underscore.
- Set the count to how many prefixed UUIDs you need, from a single ID up to a large batch for seeding.
- Choose a separator from the dropdown: None for compact IDs, underscore for the most readable convention, or dash if your system requires it.
- Select whether to strip dashes from the UUID portion — choose Yes for URL-safe compact IDs or No to keep standard UUID formatting.
- Click Generate, then copy the output list directly into your seed file, fixture JSON, or test setup code.
Use Cases
- •Seeding a PostgreSQL users table with user_ primary keys matching your production ID scheme
- •Generating pi_ and cus_ mock IDs for Stripe API fixture files used in Jest unit tests
- •Populating a Cypress fixture with consistent order_ and invoice_ IDs across related JSON entities
- •Creating sess_ session tokens for auth integration tests in a Node.js or Go microservice
- •Building a CSV import file with prod_ SKU identifiers for a product catalog migration script
Tips
- →Match your prefix convention to the entity's plural noun abbreviated: usr_ for users, org_ for organizations, keeps it guessable.
- →If you're mimicking Stripe's format, strip dashes and use no separator — Stripe IDs look like ch_3OqX8... with no UUID dashes.
- →Generate IDs with the same settings your production code will use — mismatched formats between test and real data cause subtle validation bugs.
- →For multi-entity seed files, generate each entity type separately with its own prefix, then combine the lists to keep IDs visually distinct.
- →Avoid prefixes that could collide with existing conventions: id_, db_, and sql_ are risky choices in many frameworks and ORMs.
- →When storing prefixed UUIDs, index only the UUID portion if you need UUID-specific lookups — store the full prefixed string but search by substring after the separator.
FAQ
why do APIs like Stripe use prefixed UUIDs instead of plain UUIDs
Prefixed UUIDs embed entity type directly into the ID, so any developer reading a log, webhook payload, or error message knows immediately what cus_ or pi_ refers to without a database lookup. It also makes accidental cross-entity ID substitution obvious at a glance, which catches bugs early.
should I strip dashes from the UUID part of my prefixed ID
Strip dashes when IDs appear in URLs, query strings, or systems with character limits — a dash-free UUID is 32 characters instead of 36. Keep dashes when readability matters or when downstream tooling needs to parse the UUID portion as a standard format. Stripe keeps dashes; many internal systems drop them.
can I use prefixed UUIDs as database primary keys
Yes. Store them as VARCHAR or TEXT rather than a native UUID column type, since the prefix disqualifies them from UUID-specific storage optimizations. Index performance is still strong for lookup-by-ID workloads, though avoid using them as foreign keys across many large join tables where extra string length has cumulative storage cost.