World’s largest virtual agentic engineering & quality conference
This free online tool allows you to generate random JSON code based on an editable JSON template. Write json-generator style tags in the template editor, click Generate, and get fresh random JSON that developers and QA personnel can use to test applications and simulate different inputs. This tool is built and maintained by TestMu AI (formerly LambdaTest).
A Random JSON Generator is a tool that instantly produces sample JSON (JavaScript Object Notation) data from an editable template, so you do not have to hand-write fixtures. JSON is a lightweight, text-based data format standardized by RFC 8259 and ECMA-404, which is why it moves cleanly across programming languages, REST APIs, and databases. Every structure this TestMu AI tool returns is well-formed JSON with any number of random values, ready to save as a .json file and drop straight into your project.
Random JSON is useful anywhere you need realistic sample data without exposing production records. Common use cases include:
Once you have your sample data, validate it against the JSON spec with our JSON Validator, explore the structure in the JSON Viewer, or turn it into a JavaScript object with our JSON to Object tool.
The template editor above understands these tags directly: write them inside your structure, click Generate, and each tag is replaced with a random value in your browser. The same tag style is used by template-driven generators and libraries such as faker.js, so the reference below doubles as a portable cheat sheet for designing your own schemas.
| Template tag | What it generates |
|---|---|
| {{repeat(5)}} | Repeats the next array element five times, producing an array of five objects. |
| {{firstName()}} / {{lastName()}} | A random first name or last name. |
| {{email()}} | A random, well-formed email address. |
| {{integer(18, 65)}} | A random whole number between the two bounds. |
| {{floating(5, 500, 2)}} | A random decimal with the given precision, handy for prices. |
| {{bool()}} | A random true or false value. |
| {{guid()}} | A random RFC 4122 UUID / GUID string. |
| {{objectId()}} | A random 24-character MongoDB-style ObjectId. |
| {{lorem(1, "sentences")}} | Placeholder lorem ipsum text - words, sentences, or paragraphs. |
| {{random("a", "b", "c")}} | Picks one value at random from the list you provide. |
The same idea powers code libraries: faker.js (and its faker-js/faker successor) exposes helpers like faker.person.fullName() and faker.internet.email(), so you can generate matching data inside JavaScript or TypeScript tests. Once you have a sample, turn it into a typed interface with our JSON to TypeScript tool, or derive a contract for it with the JSON Schema Generator.
Paste any of these templates straight into the editor above and click Generate, or reuse them in your own faker.js script or fixture files. Each example shows the template on top and a sample of the JSON it produces below, using the tags from the reference above.
Template
[
'{{repeat(3)}}',
{
id: '{{guid()}}',
firstName: '{{firstName()}}',
lastName: '{{lastName()}}',
email: '{{email()}}',
age: '{{integer(18, 65)}}',
isActive: '{{bool()}}',
bio: '{{lorem(1, "sentences")}}'
}
]Sample output
[
{
"id": "9f1c2d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f",
"firstName": "Ava",
"lastName": "Bennett",
"email": "ava.bennett@example.com",
"age": 27,
"isActive": true,
"bio": "Lorem ipsum dolor sit amet consectetur."
},
{
"id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"firstName": "Noah",
"lastName": "Carter",
"email": "noah.carter@example.com",
"age": 41,
"isActive": false,
"bio": "Sed do eiusmod tempor incididunt ut labore."
}
]Template
[
'{{repeat(2)}}',
{
productId: '{{objectId()}}',
name: '{{lorem(2, "words")}}',
price: '{{floating(5, 500, 2)}}',
currency: 'USD',
inStock: '{{bool()}}',
tags: [
'{{repeat(2)}}',
'{{lorem(1, "words")}}'
]
}
]Sample output
[
{
"productId": "6512a4f0c3b2e11a7d9f4c22",
"name": "aliquam vestibulum",
"price": 129.95,
"currency": "USD",
"inStock": true,
"tags": ["mauris", "tortor"]
},
{
"productId": "6512a4f0c3b2e11a7d9f4c23",
"name": "pharetra dignissim",
"price": 42.5,
"currency": "USD",
"inStock": false,
"tags": ["lectus", "vivamus"]
}
]Template
[
'{{repeat(3)}}',
{
sensorId: '{{guid()}}',
metric: '{{random("temperature", "humidity", "pressure")}}',
value: '{{floating(0, 100, 2)}}',
unit: '{{random("C", "%", "hPa")}}',
recordedAt: '{{date(new Date(2024, 0, 1), new Date(), "YYYY-MM-ddThh:mm:ssZ")}}'
}
]Sample output
[
{
"sensorId": "b7e2f4a1-9c3d-4e5f-8a6b-1c2d3e4f5a6b",
"metric": "temperature",
"value": 21.74,
"unit": "C",
"recordedAt": "2024-03-11T08:42:15Z"
},
{
"sensorId": "c8f3a5b2-0d4e-5f6a-9b7c-2d3e4f5a6b7c",
"metric": "humidity",
"value": 63.28,
"unit": "%",
"recordedAt": "2024-05-02T14:07:53Z"
}
]Random JSON is most useful once it feeds a real workflow. Save the output as a .json file and reuse it to stand in for a live backend, populate a test database, or drive a load test - all without touching production data.
Serve the sample from a lightweight mock server so your frontend has realistic data before the backend is ready.
# save the generated output as db.json, then: npx json-server --watch db.json --port 4000 # GET http://localhost:4000/users now returns your mock data
Insert the records straight into MongoDB or PostgreSQL to give integration tests a known starting state. For PostgreSQL you can load the array with a small script or with json_populate_recordset() in psql.
// seed.js -> node seed.js
const { MongoClient } = require('mongodb');
const users = require('./users.json');
(async () => {
const client = await MongoClient.connect('mongodb://localhost:27017');
await client.db('app').collection('users').insertMany(users);
console.log('Seeded', users.length, 'documents');
await client.close();
})();Use the same file as the request body in k6 or JMeter to replay realistic payloads under load. In JMeter, point an HTTP Request sampler at the file, or wire it through a CSV / JSON data set to vary each request.
import http from 'k6/http';
const payload = open('./users.json');
export default function () {
http.post('https://api.example.com/users', payload, {
headers: { 'Content-Type': 'application/json' },
});
}Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance