JSON Generator
Generate fake JSON data for testing, mock APIs and demos. Write a template with placeholders like {{fullName}}, {{email}} or {{int(1, 100)}}, choose how many records you need, and get realistic random JSON in one click. Runs in your browser, nothing is uploaded.
JSON Template
Generated JSON
What Is a JSON Generator?
A JSON generator creates sample data so you do not have to type it by hand. Developers use it to fill a mock API, test a table or chart with many rows, seed a database, write unit tests, or show a design with realistic content. This one works from a template: you write the shape of one record in normal JSON, put placeholders where random values should go, and the tool creates as many records as you need.
How to Generate JSON Data
- Click Sample to load an example template, or write your own.
- Put placeholders in strings, like
"{{email}}"or"{{int(1, 100)}}". - Enter the number of records (up to 10,000) and click Generate JSON, or press Ctrl + Enter.
- Copy the result, download it as a .json file, or open it in another tool.
Example
{
"id": "{{index}}",
"name": "{{fullName}}",
"email": "{{email}}",
"age": "{{int(18, 65)}}",
"role": "{{pick(admin, editor, viewer)}}"
}[
{
"id": 1,
"name": "Grace Turner",
"email": "grace.turner62@test.example",
"age": 57,
"role": "editor"
},
{
"id": 2,
"name": "Ava Taylor",
"email": "ava.taylor43@example.net",
"age": 26,
"role": "admin"
}
]A string that holds only one placeholder takes its type, so "{{int(18, 65)}}" becomes the number 57, not the text "57". Placeholders inside longer text are joined in: "User #{{index}} from {{city}}" gives "User #1 from Dublin". Values without placeholders, like 42 or null, stay as they are.
Placeholders
| Placeholder | Gives | Example value |
|---|---|---|
{{index}} | Record number: 1, 2, 3 ... (inside a repeat, the item number) | 1 |
{{uuid}} | Random UUID version 4 | "0f8b8673-8b42-4835-884f-3e32248c1e89" |
{{objectId}} | 24-character hex id, like a MongoDB ObjectId | "d9ff8d085b8cf8d6ab84300f" |
{{int(min, max)}} | Whole number, min and max included (default 0 to 100) | 42 |
{{float(min, max, digits)}} | Decimal number (default 0 to 1, 2 digits) | 164.6 |
{{bool}} | true or false | true |
{{pick(a, b, c)}} | One of the choices; numbers and true/false keep their type | "editor" |
{{firstName}} {{lastName}} {{fullName}} | Made-up names | "Grace Turner" |
{{username}} {{email}} | Built from the same name as the rest of the object | "grace.turner62@test.example" |
{{phone}} | Phone number in a fictional 555 range | "+1-352-555-6322" |
{{company}} | Made-up company name | "Silver Labs" |
{{street}} {{city}} {{country}} {{zip}} | Address parts | "369 Hill Street" |
{{latitude}} {{longitude}} | Coordinates with 6 decimals | 70.391684 |
{{date(start, end)}} | Date as YYYY-MM-DD (default 2020 to 2026) | "2024-01-23" |
{{datetime(start, end)}} | Date and time in ISO 8601, UTC | "2020-08-13T04:47:20Z" |
{{word}} {{lorem(count)}} | One word, or a sentence of count words | "Stone green quick yellow engine." |
{{url}} {{ip}} | Link on an example domain, IPv4 address | "185.167.235.29" |
{{color}} {{hexColor}} | Color name, or a hex code | "#87a96e" |
Lists and Nested Data
Nested objects work as you would expect. For a list of random length, put "{{repeat(n)}}" or "{{repeat(min, max)}}" as the first item of an array, followed by the item to repeat:
{
"customer": "{{fullName}}",
"orders": [
"{{repeat(1, 3)}}",
{ "line": "{{index}}", "total": "{{float(5, 500)}}" }
]
}If the template itself is an array or a single value, it is filled once and the Records number is not used. That way you can build any shape, for example ["{{repeat(50)}}", "{{email}}"] for a plain list of 50 email addresses.
Tips
- Safe fake data: names, emails, phone numbers and companies are made up. Emails use example domains and phone numbers use the fictional 555 range, so test data never reaches a real person.
- Need the types? Send the result to JSON to TypeScript or JSON Schema Generator with Open in.
- Need a spreadsheet? Convert the records with JSON to CSV or JSON to Excel.
- Want real-world data instead? Browse the free JSON datasets.
Frequently Asked Questions
How do I generate random JSON data?
Write a JSON template with placeholders such as {{fullName}}, {{email}} or {{int(1, 100)}}, enter how many records you need and click Generate JSON. Each click gives new random values.
Can I generate nested objects and arrays?
Yes. Nested objects are filled too, and an array that starts with {{repeat(n)}} or {{repeat(min, max)}} repeats the item after it, so you can create lists of any length.
Is the generated data real?
No. Names, emails, phone numbers and companies are made up. Emails use example domains and phone numbers use the fictional 555 range, so the data is safe to use in tests.
Is my template uploaded?
No. The data is generated in your browser and nothing leaves your device.