What does the JSON Generator do?
The JSON Generator builds realistic, structured mock JSON array datasets from configurable field schemas, data types, and custom record counts in real time. Executing 100% in-browser on blueutils.com, it synthesizes mock datasets using specialized generators (UUIDs, sequential IDs, names, emails, phone numbers, locations, dates, custom numerical ranges, and lorem ipsum text).
- Real-Time Zero-Latency Synthesis: Generates mock JSON as you add fields or adjust record counts with live record size metrics (
X Records). - Rich Data Generators: Supports 12+ data types including UUIDs, Sequential IDs, First/Last/Full Names, Domain-customized Emails, Phone Numbers, Cities, Countries, Numbers (with Min/Max/Decimals), Booleans, Dates (with Start/End bounds), and Paragraph Text.
- In-Browser Execution: All synthetic data generation runs locally without transmitting your test configurations to external servers.
Core Concepts & Technical Specifications
- Schema Definition & Generators:
- Identifiers (
id): Generates RFC 4122 v4 UUIDs or incrementing sequential numbers starting from a custom index. - Personal Info (
firstName,lastName,fullName,email,phone): Synthesizes realistic personal identities and formatted phone numbers. - Geographic Data (
city,country): Populates global metropolitan and country names. - Numeric Bounds (
number): Generates uniform random numbers bounded bymin,max, and configureddecimals. - Date Intervals (
date): Generates ISO 8601YYYY-MM-DDtimestamps betweenstartandendbounds.
- Identifiers (
- Deterministic Synthesizing:
- Always outputs strictly compliant RFC 8259 JSON array structures formatted with 2-space indentation.
- In-Browser Privacy:
- All dataset generation logic runs 100% locally in browser memory.
- Generated records and schema parameters are never stored, logged, or sent across the network.
How to use the tool?
- Configure Schema Fields:
- Click Add Field to define field names and assign data types (e.g.
userIdasID (UUID),emailasEmail Address, orscoreasNumber (Range)).
- Click Add Field to define field names and assign data types (e.g.
- Set Record Count:
- Enter your desired row count in the Rows input (supports 1 to 1000 records).
- Copy or Download:
- Mock JSON appears instantly on the right. Click Copy to copy to your clipboard or Download to save as
output.json.
- Mock JSON appears instantly on the right. Click Copy to copy to your clipboard or Download to save as
Pipeline & Contextual Workflows
- API Mocking & Fixtures: Generate realistic JSON mock datasets to seed integration tests, Storybook mocks, and Cypress fixtures.
- TypeScript Generation: Generate typed interfaces from synthesized datasets using JSON to TypeScript Converter.
- Tabular Export: Convert generated mock records to tabular spreadsheets using JSON to CSV Converter.
- Schema Validation: Validate generated records against strict schemas using JSON Schema Validator.
REST API Integration
blueutils.com provides a free REST API endpoint (POST https://blueutils.com/api/json/generate) to programmatically generate structured mock JSON datasets in CI/CD pipelines, automated seeders, and test runners.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
fields / schema |
Array | Non-empty array of field configuration objects containing name, type, and optional options. |
[{"name":"id","type":"id"}] |
count / rows / limit |
Number | Count of mock objects to generate (min: 1, max: 20 for API). Defaults to 10. |
3 |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/json/generate \
-H "Content-Type: application/json" \
-d '{
"fields": [
{ "name": "userId", "type": "id", "options": { "format": "uuid" } },
{ "name": "userName", "type": "fullName" },
{ "name": "userEmail", "type": "email" },
{ "name": "city", "type": "city" }
],
"count": 3
}'Python
import requests
url = "https://blueutils.com/api/json/generate"
payload = {
"fields": [
{"name": "userId", "type": "id", "options": {"format": "uuid"}},
{"name": "userName", "type": "fullName"},
{"name": "userEmail", "type": "email"},
{"name": "city", "type": "city"}
],
"count": 3
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"fields": [
{ "name": "userId", "type": "id", "options": { "format": "uuid" } },
{ "name": "userName", "type": "fullName" },
{ "name": "city", "type": "city" }
],
"count": 2
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/json/generate"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Returns true if dataset generation succeeded. |
true |
result |
String | Formatted JSON string containing generated object array. | "[{\n \"userId\": \"...\"\n}]" |
data |
Array | Parsed JavaScript array containing the generated objects. | [{"userId":"..."}] |
originalSize |
Number | Byte size of the input field schema definition in UTF-8. | 140 |
resultSize |
Number | Byte size of the generated mock JSON payload in UTF-8. | 450 |
recordCount |
Number | Total count of generated mock records in the returned array. | 3 |
fieldCount |
Number | Number of fields configured per object. | 4 |
error |
String | Detailed error explanation returned on invalid syntax or rate limits. | "Fields configuration must be a non-empty array." |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"result": "[\n {\n \"userId\": \"e12d5d8e-3be7-463d-82d2-5a9d8c2e6840\",\n \"userName\": \"John Smith\",\n \"userEmail\": \"john.smith84@blueutils.dev\",\n \"city\": \"New York\"\n }\n]",
"data": [
{
"userId": "e12d5d8e-3be7-463d-82d2-5a9d8c2e6840",
"userName": "John Smith",
"userEmail": "john.smith84@blueutils.dev",
"city": "New York"
}
],
"originalSize": 140,
"resultSize": 165,
"recordCount": 1,
"fieldCount": 4
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Fields configuration must be a non-empty array."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to generate mock JSON?
Automating synthetic JSON data generation simplifies modern testing workflows:
- Database Seeders & E2E Tests: Produces realistic mock relational records to seed ephemeral databases during automated test suites.
- LLM Context Optimization: Generates realistic dummy data without consuming costly LLM completion tokens or suffering from repetitive outputs.
- Deterministic Reliability: Produces strictly compliant RFC 8259 JSON structures with valid UUIDs, timestamps, and number ranges.
Native Usage
Generate mock JSON data locally across terminal environments and programming runtimes:
Linux / macOS (Node.js)
# Generate mock JSON using Node.js in Linux / macOS
node -e "const data = Array.from({length: 3}, (_, i) => ({id: i + 1, active: true})); console.log(JSON.stringify(data, null, 2));"Windows (PowerShell)
# Generate mock JSON in PowerShell using Python
python -c "import json, random, uuid; print(json.dumps([{'id': str(uuid.uuid4()), 'score': random.randint(1,100)} for _ in range(3)], indent=2))"Python
import json
import random
import uuid
data = [
{
"id": str(uuid.uuid4()),
"name": random.choice(["Alice", "Bob", "Charlie"]),
"score": random.randint(10, 100)
}
for _ in range(3)
]
print(json.dumps(data, indent=2))Java (Jackson)
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class Main {
public static void main(String[] args) throws Exception {
List<Map<String, Object>> list = new ArrayList<>();
for (int i = 1; i <= 3; i++) {
Map<String, Object> record = new HashMap<>();
record.put("id", UUID.randomUUID().toString());
record.put("index", i);
list.add(record);
}
ObjectMapper mapper = new ObjectMapper();
System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(list));
}
}