Random string generator
Codes, SKUs, booking references and hex digests, shaped exactly the way your system expects them — described by a short pattern or a regular expression, and repeatable from a seed.
Generate random strings now
A sample from the real generator, with a fixed seed. The live version loads in a moment.
order_ref,code,digest ORD-2505-AL,ML252397,d6e9821bf75635c4 ORD-7221-VQ,KV182136,3384d2e2f92fc93b ORD-9105-MY,EW857163,e08e1ad962720d80 ORD-8957-SR,GN962616,a3a4b393031ebee1 ORD-6724-XQ,IQ916087,3b054c394c4e82bc ORD-1301-WI,HF718481,57ba4259fb72166e
Three ways to describe a string
Most test strings are not random characters; they have a format a validator checks. The generator gives you three ways to state that format, from simplest to most flexible:
| Field type | You write | You get |
|---|---|---|
| Pattern | ORD-####-?? | ORD-4821-KQ |
| Regex Pattern | [A-Z]{2}\d{6} | BX204917 |
| Hash (hex) | length 8, 16, 32, 40 or 64 | 9f2c41a07be3d815 |
Pattern has three placeholders — # is a digit, ? an upper-case letter, ~ a lower-case letter — and keeps every other character as typed. It covers most order numbers, ticket IDs and postcodes in one line nobody has to look up.
The regular-expression subset
When a pattern is not enough — a choice between prefixes, a variable length — use Regex Pattern. It runs a regular expression backwards: instead of testing a string, it produces one that would match. It supports:
- literals,
., and the classes\d \w \swith their negations\D \W \S; - character sets and ranges,
[A-F0-9], including negated sets[^…]; - groups and alternation,
(EU|US|APAC); - quantifiers
* + ?and{n},{n,},{n,m}.
Open-ended quantifiers are capped so a string stays a sensible length: * and + produce at most 8 repetitions, and any count is capped at 200. Backreferences and lookarounds are not supported — they describe conditions on a string rather than its shape, and have no single sensible way to generate. Anchors ^ and $ are accepted and ignored. A pattern outside the subset produces #ERR in that cell rather than a string that silently fails to match.
Not for secrets
Every string here comes from a seeded, non-cryptographic generator, which is exactly what makes a fixture reproducible and exactly what makes it unsafe as a secret: anyone with the seed and the schema can produce the same values. Generate API keys, session tokens, password-reset codes and real passwords with your platform’s cryptographic random source — crypto.getRandomValues() in a browser, secrets in Python — never here.
The Hash field is not a real hash either. It produces a hex string of the right length, optionally derived from another field so the same input always gives the same output, but it is not SHA-256 or MD5 of anything. Use it where a column needs to look like a digest, not where code verifies one.
Codes that must be unique
A booking reference or a coupon code usually carries a UNIQUE constraint. Turn on Unique for the column and repeats are redrawn. Size the pattern for the row count: ??## has 67,600 possible values, so 100,000 rows of it cannot be unique, while ??#### has 6.76 million and comfortably can.
Common questions
How do I generate a random alphanumeric string?
Use a Regex Pattern field such as [A-Za-z0-9]{12} for a 12-character string, or a Pattern field mixing #, ? and ~ when each position has a fixed kind of character.
Can I generate strings that match my regex?
Yes, for a practical subset: literals, ., \d \w \s and their negations, character sets and ranges, groups, alternation and the standard quantifiers. Backreferences and lookarounds are not supported, and a pattern outside the subset produces #ERR rather than a non-matching value.
Are these strings safe to use as passwords or API keys?
No. They come from a seeded, non-cryptographic generator so that test data is reproducible. Generate secrets with a cryptographic source such as crypto.getRandomValues() or Python’s secrets module.
How do I stop codes from repeating?
Turn on Unique for the column and make sure the pattern has more possible values than the number of rows you generate. Two letters and two digits allow 67,600 values; two letters and four digits allow 6.76 million.
Is the hex output a real hash?
No. The Hash (hex) field produces a hex string of the chosen length that is stable for the same input and seed, but it is not the SHA or MD5 digest of anything. Use it where a column needs to look like a hash, not where code checks one.
Related
- UUID generator — when the identifier has to be a standard UUID.
- Random number generator — numeric IDs and quantities in a range.
- Test credit card numbers — codes that must also pass a checksum.
- Text field reference — Pattern, Regex Pattern, Slug, Custom List and more.
Last updated