Error Code Sample Generator
Generates a plausible error code and message pair — for API-documentation examples, error-page mockups or test fixtures. Not tied to any real system's actual error codes.
What this generator does
Joins a prefix, a number and a description into one code, drawing each independently — so the pairing is illustrative rather than a real system's actual registry, and a description like 'Rate limit exceeded' can land next to any of the prefixes or numbers rather than only the one a real API would use for it.
What it builds, and how many ways
Each result is assembled to this shape: [prefix] + [number] + [description].
- description: 10 options
- number: 10 options
- prefix: 4 options
Taken together those banks can be assembled 400 different ways, repeating after about 25.
Some results it can produce:
- ERR-8815: Rate limit exceeded
- E-6173: Unexpected null value
- APP-ERR-4021: Validation failed
- SVC-2044: Upstream service unavailable
A fixed sample so this page stays the same between visits. Your own results are assembled at random, each slot filled independently and each press independent of the last, so the same result can come up twice — past the repeat figure above, seeing one twice is more likely than not.
How to use this tool
- Press generate for an error code.
- Generate again for a different one.
Common use cases
- API documentation examples
- Error-page design mockups
- Test fixtures for error handling
Limitations and good to know
- With 400 possible prefix/number/description combinations in total, a long session comes back round once all 400 have been shown; this is not an unlimited source of distinct codes.
Practical tips
- Keep codes stable once published; clients will match on them, and changing one silently breaks integrations.
- Pair every code with a human-readable message. A code alone helps the API author and nobody else.
Each part of the result is chosen independently with your browser's cryptographic random number generator, so every option in a bank is equally likely. How Generate Random works.
Related generators
- HTTP Status Code GeneratorA real HTTP status code with its standard meaning.
- Access Control Scenario GeneratorPairwise test cases across authentication, role, resource state and origin, with every pair of values proved covered.
- JSON Sample GeneratorGenerate a small sample JSON object with randomised placeholder values, for API mockups.
- Exception Message GeneratorA fictional exception message for a mockup, log sample or error-handling test, not tied to any real library.