JSON Schema Mock Data GeneratorReproducible fixtures from explicit constraints
Choose a count and seed; each instance is checked against your schema.
JSON Schema Mock Data Generator
JSON Schema
Generated instances
Schema and instances stay in this browser; nothing is uploaded.
Review the schema, then generate.
JSON Schema Mock Data Generator turns a contract into synthetic instances for tests, demos and API stubs. Start with the constraints your test actually depends on, rather than a production record that happens to pass today.
This seeded JSON generator accepts a defined draft-07 subset. A schema describes each record, while the quantity controls the outer collection. JSON Schema to mock data generation does not infer business relationships from field names.
Why use JSON Schema Mock Data Generator?
Keep a failing test reproducible
Save the schema, seed and settings beside the fixture. The same engine version reproduces the same batch, making a regression easier to discuss without copying real customer records.
Exercise valid limits deliberately
Boundary sampling favors feasible endpoints for numbers, lengths and collection sizes. Each candidate still passes independent schema validation; an unsupported constraint stops the run rather than becoming a convincing placeholder.
Prepare a reproducible fixture
01
Distinguish records from array items
Count starts at 5 and seed at 42. If your schema describes an array, each generated record is itself an array. Use minItems and maxItems inside the schema to constrain those inner arrays. Seed: integer from 0 to 4294967295.
02
Run only when the contract is ready
Choose normal or boundary sampling, then Generate or Ctrl/Cmd+Enter. Editing the schema or any option makes previous exports stale. Stop cancels the current run; an older task cannot replace a newer result.
03
Read failures before exporting
The report lists unsupported schema locations. Fix the contract and regenerate before copying. Example and Clear require a replacement preview, Apply and one-step Undo. Choose JSONL for one complete instance on each line.
What the generator checks
Nested contracts
Objects and arrays retain their structure. Properties, required fields and additionalProperties guide object generation; a missing optional property is different from a present null, which must be allowed by its schema.
Values from intersecting constraints
Type unions, enum and const are evaluated together with sibling constraints. A fixed value outside a numeric bound cannot become a valid sample simply because it appears in enum.
Finite collections
String length, item count and property count limits shape the result. uniqueItems applies within each generated array; it does not make every top-level record in a batch different.
Two fixture encodings
JSON always wraps the records in an outer array, including count 1. JSONL test data places an independent JSON value on each line. The input schema validates the records, not the extra JSON export wrapper. JSON uses fixed two-space indentation; JSONL keeps each instance on one line.
Supported scope and practical limits
A strict draft-07 subset
Supported families are Boolean schemas, type unions, enum, const, properties, required, additionalProperties, single-schema items, uniqueItems, size limits and inclusive or exclusive numeric bounds. Set type explicitly: a constraint alone may allow another type. The true schema produces simple integers.
Unsupported means no output
References, combinations, conditionals, pattern, format, multipleOf, tuple items and unknown keywords are rejected with paths. Literal objects inside enum or const are data, so their property names are not mistaken for schema keywords.
Boundaries are samples, not exhaustive coverage
Boundary mode seeks feasible low and high values while retaining validity. It does not enumerate every branch or combination and does not inject invalid data. Different seeds may produce identical results for a tightly constrained schema.
Bounded work can fail
Count is 1–100. Schema input is limited to 100,000 characters, AST depth 12 including properties and enum containers and 2,000 AST nodes. Generated strings are at most 1,000 UTF-16 code units, with at most 100 array items or object properties. Attempts, total operations and a five-second worker limit also apply. The total budget is 20000 operations and 1000000 output characters. The same string and collection budgets apply to const and enum values. Seed must be an integer from 0 to 4294967295.
A failed search is not an impossibility proof
Contradictory constraints, too few distinct enum values or a generation limit can prevent a sample. The error explains the detected reason; budget exhaustion does not prove that no mathematical solution exists.
Synthetic values and explicit scope
No names database, realistic locale packs, cross-field correlations, hosted mock API, remote URL import or cloud storage. Decimal precision is bounded by the browser engine; values outside its supported representation are rejected rather than silently rounded. Numbers must be finite, integer values must be safe JavaScript integers, and converting a numeric token to Number and back must retain its decimal value.
JSON Schema Mock Data Generator questions
Why does the same seed produce the same data?
A fixed seed initializes deterministic generation. Keep the schema, count, mode and engine version unchanged to repeat a batch. A constant or a one-value enum may produce the same data under every seed.
Which schema constraints are supported?
The tool implements the draft-07 families listed in the rules, with independent validation of every emitted instance. Unsupported keywords stop the whole run; they are never silently removed from your contract.
How many records can I generate?
Choose 1–100 top-level records. Nested collection limits come from the schema and the stated resource budget. Larger constraints may fail even when the requested record count is small.
Can I export NDJSON instead of a JSON array?
Yes. Select JSONL for newline-delimited JSON, also commonly called NDJSON. Each line is a full instance and may be an object, array or primitive. It is not a multiline, pretty-printed JSON array.
Is generation performed in my browser?
Yes. JSON Schema Mock Data Generator parses, generates and validates locally after loading. The schema is not sent to a mock API, and generation does not fetch external references.