Our Random JSON Generator helps developers and testers instantly create realistic, custom-formatted JSON datasets for API testing, database population, and UI prototyping.
Show/Hide Token Guide
Available Tokens:
%%index%%(Current index)%%guid%%(A random UUID)%%boolean%%(true or false)%%number.int(min,max)%%(e.g.,%%number.int(18, 65)%%)%%name.firstName%%%%name.lastName%%%%name.fullName%%%%internet.email%%%%internet.username%%%%location.city%%%%location.country%%%%image.avatar%%(A random avatar URL)%%lorem.word%%%%lorem.sentence%%
About This Random JSON Generator
Developing applications often requires a lot of data to test how the interface handles lists, profiles, or tables. Writing these JSON objects by hand is tedious, error-prone, and frankly, boring. This Random JSON Generator acts as your personal data factory. You provide the blueprint (schema) using simple placeholders, and the tool does the heavy lifting, churning out hundreds of records populated with names, emails, addresses, and numbers. It ensures your testing environment looks and feels real without you having to write a single script.
How to Use Random JSON Generator
Using this tool is straightforward, even if you are new to JSON.
- Set Quantity: In the “Number of Records” box, type how many items you need (e.g., 5, 50, or 100).
- Define Your Template: In the large text area, create your JSON structure. Use the Token Guide to find placeholders for the data you want (like
%%name.fullName%%or%%location.city%%). - Generate: Click the “Generate JSON” button. The tool will process your template and fill it with random data.
- Get Your Data: You can copy the code to your clipboard or click “Download .json” to save the file directly to your computer.
Use Cases
- Frontend Development: Quickly mock up a REST API response to style your React, Vue, or Angular components before the backend is ready.
- Database Seeding: Generate bulk data to import into MongoDB or SQL databases to test performance and queries.
- QA Testing: Create massive datasets to stress-test your application’s pagination, search, and filtering features.
- Education: Teachers can create distinct datasets for students to practice parsing JSON without everyone having the exact same file.
Tool Example
Here is a quick look at how the input translates to output.
Your Input Template:
JSON
{
"id": "%%index%%",
"name": "%%name.fullName%%",
"age": "%%number.int(18, 65)%%",
"email": "%%internet.email%%",
"isActive": "%%boolean%%"
}
The Generated Result:
JSON
[
{
"id": 0,
"name": "Michael Moore",
"age": 33,
"email": "[email protected]",
"isActive": true
},
{
"id": 1,
"name": "Emily Lee",
"age": 22,
"email": "[email protected]",
"isActive": false
}
]
Pro-Tips
- Control Your Numbers: When using the number token, you can specify ranges. For example,
%%number.int(18, 99)%%is perfect for simulating realistic user ages, whereas%%number.int(1000, 9000)%%is better for generating product prices or IDs. - Keep it Valid: Remember that the template itself (outside of the
%%tokens) must be valid JSON syntax. Ensure your keys are wrapped in double quotes (e.g.,"name":) and that you use commas to separate properties. - Images: Use the
%%image.avatar%%token to generate URLs for placeholder profile pictures. This makes your UI mockups look much more polished.
FAQs
Where can I find the list of available code words (tokens)?
You don’t need to guess them! Just click the “Show/Hide Token Guide” link located right below the text editor area. This will expand a cheat sheet showing you all the available codes, such as %%name.fullName%%, %%internet.email%%, or %%date.past%%. Simply copy and paste these into your template.
Can I mix static text with random tokens?
Yes, absolutely. You can hardcode specific values that should remain the same for every record while randomizing others.
- Example:
"role": "Admin", "username": "%%name.firstName%%"In this case, every single generated user will have the role “Admin,” but their username will be unique.
Why didn’t one of my tokens get replaced?
If you see %%name.first%% in your final output instead of a real name, it usually means there is a typo in the token. The generator is case-sensitive and needs the exact spelling. Double-check that you have included the double percentage signs (%%) on both sides and that the command matches the Token Guide exactly.
Can I generate arrays inside my JSON objects?
Yes! The generator respects whatever structure you build. If you need a user object to contain a list of tags or friends, just set up your template with square brackets [].
- Example:
"friends": [ "%%name.firstName%%", "%%name.firstName%%" ]This will generate a list of two random friends for that specific record.
Does this tool support Boolean (True/False) values?
Yes, use the %%boolean%% token.
- Important Tip: When using booleans in JSON, do not put quotes around the token if you want a real boolean value.
- Correct:
"isActive": %%boolean%%(Results in"isActive": true) - Incorrect:
"isActive": "%%boolean%%"(Results in"isActive": "true"-> a string).
- Correct:
Is the output formatted or minified?
The tool currently generates “pretty” JSON with proper indentation and line breaks. This makes it easy for humans to read and debug. If you need minified JSON (all on one line) for production use, you can run the output through our Text Minifier tool.