toolo.dev

Sample JSON Generator

Generate sample JSON for API mocks and tests. Nest objects and arrays, start from a User, Product, Order or Blog post template, and get up to 1,000 records.

Templates:

JSON Structure

1 gives a single object. More gives an array of objects (up to 1000).

About the Sample JSON Generator

Use this sample JSON generator to describe the shape of your data once and get realistic JSON back: names, emails, prices, dates, UUIDs and more. Objects and arrays of objects can nest as deep as you need, and one click makes up to 1,000 records for an API mock, a test fixture or a UI prototype.

Hand-written mock data tends to be three tidy records called "Test 1" to "Test 3". Generated data looks closer to production, and it's better at finding problems: a list of 1,000 items that scrolls slowly, a null where your code expects an object, or a long paragraph that breaks a card layout.

The values come from faker, an open-source library that your browser downloads on your first click of Generate JSON. Your structure and the result stay in the browser. Names, phone numbers and addresses use faker's English (US) data, so expect US-style phone numbers and ZIP codes.

  1. Start from a template: click User, Product, Order or Blog post next to Templates. The fields appear under JSON Structure and a first result is generated right away. The page opens with the User fields already in place.
  2. Change any field: type its name and pick a type such as Full name, Email, Price, Date (ISO) or UUID. Add Field adds a new top-level field, and the trash icon removes one. A name turns red when it's empty or a sibling field already uses it.
  3. To nest data, set a field's type to Object and add fields inside it with the button under it, for example Add field to customer. For a list, choose Array, pick what it holds in the of menu and set Length (0 to 100). Choose Objects there, then Add field to each item, to get an array of objects.
  4. Set Number of records. 1 gives a single object; 2 to 1,000 gives an array of objects.
  5. Click Generate JSON. The result appears under Generated JSON with 2-space indentation. Click Copy, or Download to save sample.json. Every click makes new values.