Skip to content
Tools

JSON Sample Data Generator

Last updated:

A JSON sample data generator turns a JSON Schema, or one example document, into as many realistic test records as you need. Pick a record count and a seed, and the same input gives the same records every time, so fixtures stay stable between runs.

Runs in your browser: your schema or sample never leaves your device – nothing is uploaded, logged or stored on a server. How we protect your data

100% in-browserNothing is uploaded

JSON Schema

Loading editor…

Paste a JSON Schema

or drop a file here. Nothing leaves your browser.

Drop a file to load it

Generated data

Loading editor…

Generated records appear here

Same seed and input always give the same output.

How to use the JSON Sample Data Generator

  1. Paste a JSON Schema, or switch "Input is" to Sample JSON and paste one example record (a list of records works too).
  2. Choose how many records you want (1 to 1,000), a seed, and whether optional fields are sometimes, always or never present.
  3. Read the output: a JSON array, or NDJSON with one record per line for bulk imports.
  4. Copy it or download sample-data.json. Change the seed for a different set, keep it for the same set.

Worked example

A small user schema, 3 records, seed 42, NDJSON output

JSON Schema

{"type":"object","properties":{"id":{"type":"integer","minimum":1},"email":{"type":"string","format":"email"},"role":{"enum":["admin","editor","viewer"]}},"required":["id","email","role"]}

Generated data (NDJSON)

{"id":1,"email":"grace.mensah23@example.net","role":"admin"}
{"id":2,"email":"kofi.chen@example.com","role":"viewer"}
{"id":3,"email":"yuki.perlman@test.example","role":"admin"}

Every record matches the schema. The id counts up from its minimum, emails use reserved example domains so nothing can reach a real inbox, and the role is picked from the enum. Run it again with seed 42 and you get these three lines again.

Which schema keywords shape the data

Draft 2020-12 and draft-07 schemas are both read. Anything not listed is ignored, and the tool tells you which keywords it skipped.

Which schema keywords shape the data
KeywordWhat the generator doesNotes
type, properties, requiredBuilds objects; required keys are always presentOptional keys follow the Optional fields setting
formatemail, uri, date, date-time, time, uuid, hostname, ipv4, ipv6, durationUnknown formats fall back to plain text
minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOfPicks a number inside the rangeIntegers stay whole; decimals have two places
minLength, maxLength, patternBuilds a string of the right length or one that matches the regexPattern support is best effort: classes, groups, alternation and counts work, lookahead does not
minItems, maxItems, uniqueItems, prefixItemsChooses a length in range and fills each positionTuples keep their position types
enum, constPicks one allowed value, or the constant
$ref, $defs, definitionsFollows local references such as #/$defs/userRecursive schemas stop growing at a safe depth
oneOf, anyOf, allOfoneOf and anyOf use the first branch; allOf merges its partsOverlapping oneOf branches can still fail oneOf
not, if/then/else, patternProperties, propertyNames, containsIgnoredListed in a note when present

Schema or sample: which should I paste?

Use a JSON Schema when you know the rules: ranges, enums, formats and required keys decide what the data may look like. Use a sample document when all you have is one real response. The generator then reads the values themselves: numbers vary around what it saw, strings that were all emails, dates or uuids keep that form, a handful of repeated words becomes an enum, and a key missing from some items becomes optional.

If you paste data while Input is set to JSON Schema, the tool says so and offers to switch. The reverse works too, so a schema pasted as a sample is not silently mangled.

Reproducible output with a seed

Each record is generated from the seed plus its position, so the first 10 records are identical whether you ask for 10 or for 1,000. That makes the output safe to commit as a test fixture and easy to extend later without rewriting the old rows. The dice button picks a new random seed when you want a fresh set.

Names, cities and companies come from short built-in word lists and are made up. No real person or company data is used, and nothing is looked up online.

Where the data goes next

A JSON array suits fixtures, mock API responses and front-end demos. NDJSON, one record per line, is what bulk importers expect, for example mongoimport, Elasticsearch bulk files after you add action lines, and BigQuery load jobs. To check that the output really fits your contract, paste the same schema into the JSON Schema validator together with a generated record. Output stops at 5 MB so the page stays responsive, and the tool tells you when that happens.

JSON Sample Data Generator FAQ

Is the generated JSON valid against my schema?

For the supported keywords, yes: the tool is tested by checking generated records against their own schemas with a standard JSON Schema validator. Ignored keywords such as not or if/then/else are listed in a note, and overlapping oneOf branches can make a value match two branches, which oneOf rejects.

How can I get the same data every time?

Keep the input, the record count and the seed the same. The generator has no clock or network input, so the output is identical byte for byte, in any browser. Changing only the count keeps the earlier records unchanged.

How many records can I generate?

From 1 to 1,000 per run, and the output is capped at about 5 MB. For more rows, run it again with a different seed and concatenate the NDJSON files.

What is the difference between a JSON array and NDJSON output?

A JSON array is one document, [ {...}, {...} ], that any JSON parser reads at once. NDJSON puts one compact record on each line, so tools can stream it and a single bad line does not spoil the file.

Can it generate data from a sample instead of a schema?

Yes. Switch Input is to Sample JSON and paste one record, or an array of records. The generator infers types, ranges, formats and optional keys from it and creates variants that look like your sample.

Does it use real names or emails?

No. Names come from a small made-up list and every email, URL and host uses reserved example domains, so none can point at a real person or server.

Does my schema leave the browser?

No. Generation runs on your device, in a background worker for large counts. Nothing is uploaded or logged, and the usage statistics, if you allow them, only record whether you used a schema or a sample and a coarse record count.

Related tools