Skip to content
JSON Tidy

Random JSON generator

Make fake JSON for tests, demos and prototypes. Start from a ready-made dataset, paste one of your own records to get more like it, or paste a JSON Schema to get records that match it. Then copy the result or download it. It all happens in your browser.

Fields
10 records · 2.4 KBOpen in viewerConvert to CSV

The same data from the fake API:

https://www.jsontidy.com/api/fake/random?dataset=runs&count=10&seed=42

Generate more JSON from a sample

Choose From your JSON and paste a record from your own API or database. You get as many as you ask for, in the same shape, with new values that look like the originals:

  • Emails, URLs, UUIDs, dates, times and phone numbers stay in the same format. An email keeps its domain and a URL keeps its site.
  • IDs like ord_1042 count up from the one you pasted. Strings of digits, such as ZIP codes, keep their length and their leading zeros.
  • Names, cities and sentences are replaced with new ones. Numbers stay in a similar range, and whole numbers stay whole.
  • Single words, like a status of shipped, are kept as they are. Paste a few records in an array and the generator picks from all the values it sees, and fields that only some records have stay optional.

Generate JSON from a JSON Schema

Choose From a JSON Schema and paste a schema. The generator follows type, required, enum, const, minimums and maximums, string lengths, format, simple patterns, $ref, oneOf, anyOf and allOf. Property names help too, so a username or a city gets a realistic value.

Each record is then checked against your schema with the same validator as the JSON Schema validator, and you’ll see whether they all pass. If some don’t, usually because of a complicated pattern, the first problem is shown. References to other files aren’t loaded, so copy those definitions into $defs first.

Messy data and edge cases

Clean test data hides bugs. Tick Messy data and some fields go missing or turn into null, and some values become empty strings, a 2,000-character string, emoji, right-to-left text, a string with quotes and line breaks, or a number too big for JavaScript like 9007199254740993. It’s a quick way to find the screen that breaks on a missing name or the parser that rounds an ID.

With a schema, the box is called Edge cases instead, and the data stays valid: strings at their shortest and longest, numbers at the minimum and maximum, empty arrays, and optional properties either all left out or all filled in. That’s what you need for testing validation rules at their limits.

The sample datasets

The ready-made datasets describe a made-up fleet of office robot vacuums. Each kind includes something real data has and test data often leaves out:

  • Robots have a nested location object, an array of modes, and a stuck_under field that’s null unless the robot is stuck.
  • Cleaning runs have ISO 8601 timestamps, and a finished_at and minutes of null when the run ended with the robot stuck.
  • Events have string IDs like evt_10fq8 and a level of info, warning or error.
  • Maintenance tickets have part numbers like "0042" that have to stay strings, prices with cents, true/false values and optional notes.

Untick fields to leave them out. You can make up to 10,000 records, which for cleaning runs is about 2.5 MB.

The same data every time

The data comes from the seed, so the same settings always give exactly the same JSON. Note the seed to make the file again later, or press Generate new data for a different set.

The address under the result returns the same records from the fake JSON API, up to 1,000 per request. That’s handy for tests, which can fetch a fixed set of records without keeping a fixture file:

// The same records every run, so snapshots and assertions don't drift
const res = await fetch("https://www.jsontidy.com/api/fake/random?dataset=tickets&count=50&seed=7");
const tickets = await res.json();
expect(tickets[0].part).toBe("0042");

Formats

JSON array is a plain list of records. Object with data and meta wraps the list the way many APIs do, so you can test code that reads response.data. NDJSON puts one record on each line, the format log pipelines, BigQuery and Elasticsearch’s bulk API read. Note that an NDJSON file as a whole isn’t valid JSON: parse it a line at a time.

To check how your code handles JSON that’s broken or unusual, like an empty body or a number too big for JavaScript, use the broken JSON test URLs.