# Sample JSON Generator — From a JSON Schema

> Turn a JSON Schema into realistic sample documents, respecting types, enums, formats and constraints.

To generate sample JSON from a schema, paste a JSON Schema and the generator walks it to build documents that satisfy every constraint — the declared types, enum values, string formats such as email or date-time, numeric minimums and maximums, array lengths and nested objects, including local $ref pointers.

**URL:** https://convertto.tech/t/sample-json-generator
**Category:** Samples & Mock Data (https://convertto.tech/c/sample-data)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

- **Schema support:** type, properties, items, required, enum, const, format, minimum/maximum, minLength/maxLength, minItems/maxItems, oneOf, anyOf, allOf and local $ref
- **Formats honoured:** email, uri, uuid, hostname, ipv4, ipv6, date, time, date-time and duration
- **Privacy:** Runs entirely in your browser — nothing is uploaded
- **Cost:** Free, unlimited, no sign-up

## How to use

1. Enter or paste your json schema.
2. Set the documents.
3. Set the items per array.
4. Set the maximum nesting depth.
5. Turn "Always include optional properties" on or off as needed.
6. Enter or paste your wrap in a key.
7. Turn "Pretty-print" on or off as needed.
8. Enter or paste your seed.
9. The result appears immediately — copy or download it.

## FAQ

### Which JSON Schema drafts are supported?

The keywords shared by draft-07 and 2020-12, which covers almost every schema in practice. Both $defs and definitions resolve for local $ref pointers; remote references are not fetched.

### Why turn off optional properties?

Because real API clients receive documents where optional fields are missing. Turning the option off randomly omits anything not listed in "required", which is how you find code that assumes a field is always present.

### Can I use an OpenAPI schema?

Yes, if you paste the schema object itself rather than the whole OpenAPI document — the component schemas under components/schemas are ordinary JSON Schema.

## Related tools

- [JSON Schema Generator](https://convertto.tech/t/json-schema-generator): Infer a JSON Schema from example data, detecting types, string formats and required keys.
- [Mock Data Generator](https://convertto.tech/t/mock-data-generator): Generate realistic fake test data in 14 formats from 100+ field types, with reproducible seeds.
- [JSON Diff](https://convertto.tech/t/json-diff): Compare two JSON documents and see exactly which keys were added, removed or changed.
- [Sample Dataset Generator](https://convertto.tech/t/sample-dataset-generator): Download ready-made sample datasets — users, orders, products, transactions — as CSV, JSON, SQL or Excel-ready TSV.
- [Sample API Response Generator](https://convertto.tech/t/sample-api-response-generator): Generate realistic REST, JSON:API, GraphQL and error-envelope responses with pagination.
- [Data Format Converter](https://convertto.tech/t/data-format-converter): Convert between JSON, YAML, XML, CSV, TSV and TOML in any direction, locally in your browser.
- [.env to JSON Converter](https://convertto.tech/t/env-to-json): Convert .env files to JSON and back — for config migrations and CI variables.
- [JSON Flattener](https://convertto.tech/t/json-flattener): Flatten deeply nested JSON into dot-notation keys, or expand flat keys back into nested objects.
- [LLM Tool Schema Converter](https://convertto.tech/t/tool-schema-converter): Move a function definition between OpenAI, Anthropic, Gemini, MCP and bare JSON Schema — or emit it as a TypeScript type or Zod schema.
