Random JSON Generator
Generate random JSON data with configurable structure, depth, key count, and value types
Set the depth, keys per object, and value types you want — then hit generate. You get valid, pretty-printed JSON with random strings, numbers, booleans, and nested structures, ready to copy or save as a .json file.
And everything runs in your browser. Nothing gets uploaded.
How It Works
You pick the rules — max nesting depth, keys per level, array sizes, and which value types are fair game. The tool walks through each level, randomly generating keys and values that match your settings. Strings get random words, numbers are random integers or decimals, and booleans flip a coin. The result is always valid JSON, formatted with 2-space indentation so it’s actually readable.
Examples
Flat object for a quick mock response
You need a simple API stub — no nesting, just key-value pairs with mixed types.
Depth: 1
Keys: 4
Types: string, number, boolean
{
"alpha": "lorquet",
"beta": 847,
"gamma": true,
"delta": 3.14
}
Nested structure for parser stress testing
Your JSON parser claims it handles arbitrary depth. Time to find out. Depth 4, arrays included, all value types on.
Depth: 4
Keys: 3
Array max: 5
Types: all enabled
{
"user": {
"profile": {
"tags": [true, 42, "xkp"],
"score": null
},
"active": false
},
"items": [{"id": 991}, 7],
"meta": "rndval"
}
Numbers-only payload for load testing
You just need a bunch of numeric values to throw at a data pipeline. Nothing fancy.
Depth: 2
Keys: 5
Types: number only
{
"alpha": 204,
"beta": {
"x": 88.7,
"y": 1023,
"z": 0.45
},
"gamma": 17,
"delta": 562,
"epsilon": 3
}
Who Uses This
Generate mock payloads for API endpoint testing without writing fixtures by hand.
Create edge-case JSON with deep nesting and mixed types to break parsers on purpose.
Get sample JSON data for class projects and homework without copying from Stack Overflow.
Prototype UI components with realistic-looking data before the real API exists.
Common Mistakes
If every type checkbox is unchecked, there’s nothing to fill the values with. The tool will show an error. Make sure at least one type — string, number, boolean, null, array, or object — stays enabled.
High depth + lots of keys = exponential growth. A depth-5 structure with 20 keys per level can produce tens of thousands of lines. Start small (depth 2, 3–5 keys) and work up.
This generator creates random structures, not schema-conformant data. If you need JSON that matches a particular API contract, you’ll have to adjust the output manually or write a custom template.
Technical Details
- Processing: 100% client-side (JavaScript, no server calls)
- Browser Support: Chrome, Firefox, Safari, Edge
- Max Depth: 5 levels of nesting
- Max Keys: 20 per object level
- Output Format: Pretty-printed JSON with 2-space indentation
Frequently Asked Questions
How do I generate random JSON data?
Set the depth, key count, and array length at the top of the tool. Toggle on the value types you want (strings, numbers, booleans, etc.), then click Generate. The JSON appears instantly in the output box — copy it or download it as a file.
Is randomly generated JSON valid?
Yes. The output follows the JSON specification exactly — proper quoting, commas, brackets, the works. You can paste it into any JSON validator or parser and it will pass without errors.
Can I control which data types appear in the output?
Each type has its own toggle — string, number, boolean, null, array, and nested object. Turn off what you don’t need. Want numbers only? Disable everything else. The generator respects whatever combination you pick.
Does this tool upload my data to a server?
No. Everything runs in your browser using JavaScript. No data is sent to any server, nothing gets logged, and closing the tab erases everything. It is as private as it gets for a web tool.
What is the maximum size of JSON I can generate?
Depth caps at 5 and keys per object at 20. In practice, a maxed-out configuration can produce several kilobytes of JSON. For most testing needs that’s plenty. If you need massive files, generate multiple times and combine the results.