About Mock JSON Generator
Front-end work often stalls while the real API is not ready. Describe the objects you expect, one field per line such as id: id, name: fullName or plan: oneOf(free, pro), and get back a pretty-printed JSON array to serve from a mock endpoint or load in a story or a unit test.
Numbers and booleans come out as real JSON numbers and booleans, a field marked with ? is sometimes null, and the same seed always rebuilds the same array, so a snapshot test stays green.
How it works
- Each line of the schema is a field name, a colon and a type, with optional settings in parentheses: integer(1, 100), decimal(0, 5, 1), date(2020-01-01, 2025-12-31), oneOf(red, green, blue), words(4) or boolean(80) for 80% true.
- Other types: id, uuid, firstName, lastName, fullName, email, username, phone, company, jobTitle, street, city, country, countryCode, postcode, latitude, longitude, product, sku, price, word, sentence, paragraph, url, ipv4, color, currency and datetime.
- A ? after the type makes the field empty (null) in about one row in five, for testing how your code handles missing values.
- Values come from a seeded generator, so a given seed and schema always produce the same rows. It is not suitable for anything secret, such as passwords or tokens.
Questions
Can I describe nested objects?
No. Each record is a flat object with one key per field you list. For nested data, generate the parts separately and combine them, or flatten the shape your code expects into dotted names.
How do I get the same JSON again later?
Keep the schema and the seed. The generator is deterministic, so the same pair always gives exactly the same array, which is what a snapshot or fixture test needs.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.