JSON Schema Fake Data Generator
Generate mock JSON datasets, NDJSON files, and CSV files from JSON Schema definitions, with verified output, seed control, and Web Worker execution.
Last updated:
The JSON Schema Fake Data Generator creates mock datasets from JSON Schema definitions. Schemas are validated using Draft-06, Draft-07, Draft 2019-09, or Draft 2020-12. It helps developers and QA engineers create test data and mock API responses.
✨ Key Features
- Side-by-Side Monaco Editor: High-performance dual-pane code editor with syntax highlighting, line numbers, and error diagnostics.
- Verified Output: Each generated record must pass Ajv validation before any JSON, NDJSON, or CSV export is enabled. Invalid schemas, unresolved references, unknown formats, and generation failures display errors; they are never treated as valid output.
- Basic Constraints: Respects types, required fields, string lengths, supported formats, numeric bounds and
multipleOf, array sizes anduniqueItems, and object property counts. - Custom Semantic Checker: Detects contradictory schema boundaries (e.g.,
minimum > maximumor impossible array lengths) before generating data. - Plain JSON Auto-Detection: Paste any regular JSON object or array, and convert it to a valid JSON Schema with a single click.
- Customizable Generation Controls:
- Record Count: Generate 1 to 50 records at a time.
- Default Array Size: Control item count for array properties when
minItemsormaxItemsare unspecified. - Seed Randomization: Re-roll seeds for different datasets. A fixed seed also uses a fixed reference date so relative dates are repeatable with the same schema, options, and Faker version.
- Web Worker Execution: Offloads heavy data generation calculations to a background worker thread via Comlink to keep the browser responsive.
- Multiple Export Formats: Download generated data as formatted JSON, newline-delimited JSON (NDJSON), or flattened CSV files. CSV uses the shared exporter so headers and values containing commas, quotes, or line breaks remain valid.
- Tool Connections: Use Open in… to send the exact validated collection to JSON Editor, Converter, or a Mock API snapshot. The snapshot opens the current records in the standalone Mock API and can then be edited independently. The Build rerunnable workflow submenu creates Pipeline recipes for Table View, Mock Output, or File Export while preserving the current schema, record count, seed, default array size, and optional-field setting. Transfers open a separate session that autosaves for the current browser tab. The compact notice shows the source and destination; use its info button for persistence and validation details. Close it with × and reopen it by clicking the tab session badge. Reloading restores saved tab changes. Save or download your work before closing the tab. If a standalone session already exists, it is preserved and Save as standalone session asks before replacing it. If there is no saved session, use Save this session to promote the imported work or Discard imported data to leave it untouched.
- From an Example: In the standalone JSON Schema Generator, click Generate fake data to transfer the current schema, including manual edits, to this tool. Inferred schemas describe structure; add domain constraints if needed.
🛠️ How to Use
- Navigate to the JSON Schema Fake Data Generator tool.
- Enter or paste your JSON Schema definition in the left panel (or paste plain JSON and click Convert to Schema).
- Customize generation settings (Record Count, Array Size, Seed) in the toolbar.
- Data is generated automatically when the schema or options change. Regenerate chooses a new random seed.
- Check the Validated status, then use Download to export your data as JSON, NDJSON, or CSV.
- Use Open in… to edit fixtures in JSON Editor, export other formats in Converter, or open a Mock API snapshot from the current records. Use Open in… → Build rerunnable workflow when you want a Pipeline that regenerates records from the schema and preserved settings. Editing transferred records in JSON Editor does not revalidate against the original schema.
NDJSON exports one validated record per line, without an outer array. This makes generated fixtures convenient for streaming tools, logs, queues, and data pipelines.
Each generated record is a complete document matching your schema. If the root schema describes an array, each record is itself an array; transfers keep this structure intact. Transfers to Editor and Converter include the full outer collection. Transfer tokens expire after ten minutes and are consumed once. After opening a transfer, its working session survives refresh in the same tab. Save it as your standalone session or download the result before closing the tab. Use Share for a reusable link. Shared links in Schema Data Generator, Editor, Converter, and Mock API also open isolated tab sessions; edits do not overwrite the usual standalone session unless explicitly saved as that session. This saves a snapshot; further edits remain in the temporary tab session until saved again. Storage failures are shown explicitly, and replacing a session is blocked if it changed in another tab after confirmation was opened.
Generation limits
The generator supports local JSON Pointer references, common schema combinations, and the string formats date-time, date, time, email, uuid, uri, ipv4, ipv6, hostname, and duration. Pattern generation supports a subset of regular expressions, including ranges and bounded repetition; complex patterns may not be generatable. All constraints are still checked against the original schema before export.
Validation coverage is broader than generation coverage: advanced keywords such as patternProperties, propertyNames, contains, and conditional schemas are validated when present, but may not always provide enough information for the generator to construct a matching value. In those cases the tool reports that it could not generate conforming data instead of exporting an unverified result.
Generation uses bounded retries and limits generated arrays and objects to 1,000 items or properties, strings to 10,000 characters, and each record to 10,000 generated values and 15 levels of nesting. A schema may declare a larger upper bound; the generator chooses a value within its own safety limit as long as the schema permits it. Schemas requiring more work, required infinite recursion, external references, and asynchronous validation fail explicitly. An error can mean the generator cannot find a conforming value within these limits, rather than that the schema itself is invalid.
🗂️ Metadata & Links
- Tool URL:
/schema/data-generator - Documentation:
/docs/tools/schema-data-generator
🚀 Try it now
Generate realistic mock data online at the JSON Schema Fake Data Generator.