JSON Generator
Generate a sample JSON object with a random id and the current timestamp in one click. Built in your browser.
Generate a sample JSON object with a random id and the current timestamp in one click. Built in your browser.
This JSON generator creates a small random sample JSON object you can copy straight into a test, a mock server or a request body. Press Run Tool and the output box fills with one formatted object. The shape is always the same, but two fields change on every run:
{
"id": "k3f9q2p1x7a",
"name": "Sample",
"active": true,
"createdAt": "2026-09-01T09:42:18.204Z"
}
id is a short random string from Math.random().toString(36), name is always "Sample", active is always true, and createdAt is the moment you clicked, formatted as an ISO 8601 timestamp with new Date().toISOString(). The output is indented with two spaces and is always valid JSON.
id and timestamp, for example one per test case.id uses lowercase letters and digits only (base 36) and is usually 10 or 11 characters long, occasionally shorter. It can start with a digit and could in rare cases be all digits, which is a good way to check that your code does not convert string IDs to numbers.name is the fixed string "Sample", a predictable value you can assert on in tests.active is the boolean true, not the string "true", so it is useful for checking that a client keeps JSON types intact.createdAt is always UTC: it ends with Z and includes milliseconds. Your local time zone never appears in it, whatever your computer is set to.Click Run Tool, then Copy, and paste the minified object into curl:
curl -X POST https://api.example.com/items \
-H "Content-Type: application/json" \
-d '{"id":"9qz2m4k7p1a","name":"Sample","active":true,"createdAt":"2026-09-01T09:42:18.204Z"}'
Because createdAt is a real timestamp, the object is a quick check that your stack parses ISO 8601 with milliseconds:
// JavaScript
new Date(obj.createdAt).getTime(); // milliseconds since 1970
# Python 3.11+
datetime.fromisoformat(obj["createdAt"]) # aware datetime in UTC
// Java
Instant.parse(obj.getString("createdAt"));
Older Python versions (3.10 and earlier) reject the trailing Z in fromisoformat; replace it with +00:00 first.
The page generates one object per click. When you need a list, the same logic runs in a line of JavaScript in your browser console or Node.js:
const rows = Array.from({ length: 5 }, () => ({
id: Math.random().toString(36).slice(2),
name: 'Sample',
active: true,
createdAt: new Date().toISOString()
}));
console.log(JSON.stringify(rows, null, 2));
Objects made in the same loop share almost the same createdAt; add an offset such as new Date(Date.now() - i * 60000) if you need distinct times.
The generator is a starting point, not a schema engine. You cannot choose fields, types or the number of objects on this page, and the id is not guaranteed unique: Math.random() is not a cryptographic source, so do not use it for tokens, secrets or primary keys in production. For test fixtures and demos it is fine.
Because id and createdAt change on every run, do not paste a generated object into a snapshot test and expect it to match next time. Either freeze the two values by hand after copying, or assert on their shape instead, for example expect(obj).toEqual({ id: expect.any(String), name: 'Sample', active: true, createdAt: expect.any(String) }) in Jest.
Use this page when you need one valid object immediately. For realistic test data with names, emails, addresses, dates and UUIDs across many rows, exported as JSON, CSV or SQL, use the mock data generator. For ready-made files with arrays and nested objects, download one of the sample JSON files. For a real RFC 4122 identifier use the UUID generator, and for random timestamps across a range use the random date generator. To grow the generated object into a bigger structure, paste it into the online JSON editor and add fields with live validation.
One pretty-printed JSON object with four fields: id (a short random base-36 string), name (the literal value "Sample"), active (the boolean true) and createdAt (the current time as an ISO 8601 string in UTC). Press Run Tool again for a new id and timestamp.
No. The object is created from scratch each time, so anything typed in the input box is ignored. The box is shared with other modes of the same tool. Edit the generated object by hand, or in the online JSON editor, to change the shape.
It comes from Math.random().toString(36) and is about 11 characters long, so collisions are very unlikely in small test sets, but it is not guaranteed unique or secure. Use the UUID generator for real identifiers.
Not on this page. Run the one-line JavaScript loop shown above in your browser console, or use the mock data generator, which creates many rows at once.
No. The object is built in your browser with JavaScript. Nothing is uploaded or stored, and the tool works offline once the page has loaded.