What does the random JSON generator create?
It creates a JSON array of sample objects, from 1 to 50 of them (5 by default). Each object has the same four fields: an id counting up from 1, a name of 3 to 8 random lowercase letters, an integer value from 1 to 1000 and an active boolean. Output is pretty-printed with 2-space indentation and is always valid JSON.
Think of it as instant filler for a list endpoint: enough structure to render a table, page through results or test a filter, without writing fixtures by hand.
Field reference
| Field | JSON type | Possible values | How it's generated |
|---|---|---|---|
id |
number | 1 up to the object count | Sequential, not random |
name |
string | 3 to 8 letters, a to z | Length and each letter picked at random |
value |
number | Whole numbers 1 to 1000 | Uniform random integer |
active |
boolean | true or false |
50/50 coin flip |
All random choices use crypto.getRandomValues() with rejection sampling, so no value in a range is favoured.
Generating an array
- Set the Objects slider (1 to 50).
- Click Generate.
- Click Copy and paste into your mock file, test or API stub.
Two objects looked like this:
[
{
"id": 1,
"name": "tgmjnei",
"value": 572,
"active": false
},
{
"id": 2,
"name": "qhyknrvo",
"value": 79,
"active": false
}
]
Notice both objects came out inactive. That happens more often than people expect: with 5 objects there's a 1 in 32 chance (about 3%) that every active is false, and the same for all true. If your UI has a "show active only" filter, keep generating small batches and you'll eventually get to test the empty state for free.
Where it's useful
- Front-end work before the API exists. Return the array from a stubbed
fetchand build the list view against it. - Pagination and scrolling. 50 objects is enough to see a second page at typical page sizes of 10 or 20.
- Sorting checks. Sorting by
valueexercises numeric sort; sorting bynameexercises string sort. A table that sorts 79 after 572 is comparing numbers as strings. - Teaching JSON. The four fields cover three of the value types JSON defines: number, string and boolean.
What it doesn't generate
The schema is fixed, and the data is deliberately plain. You won't get:
- nested objects or arrays inside an object
nullvalues or missing fields- decimals, negative numbers or very large numbers
- strings with spaces, accents, emoji or characters that need escaping, like
"or\ - realistic names, emails or dates
Those are exactly the inputs that break JSON handling code, so add a few by hand once your happy path works. The format itself is defined in RFC 8259, which spells out the escaping rules for strings and the limits on number formats if you want to craft edge cases deliberately.
Next steps with the output
Paste the array into the JSON formatter to re-indent it or collapse it, or the JSON validator after you've hand-edited it, since a missing comma is the usual casualty. The JSONPath tester is a quick way to practise queries such as selecting every name. And if someone non-technical needs to see the data, the JSON to Excel converter turns the array into a spreadsheet with one row per object.
Last updated