Skip to content
Simple Tools

Sample JSON generator

Create one deterministic sample from a bounded schema and check it before returning output.

Enter data

A supported 2020-12 schema and an object member-scope choice. Fields marked with an asterisk are required.

Up to 50,000 UTF-16 units. Paste an anonymized document, not secrets.

About this tool

A sample helps prepare a form or API test but does not replace boundary-case coverage. The generator creates one repeatable document with placeholders, not realistic personal data. It prefers compatible const, default and enum values, then basic type candidates. Output is parsed and validated again; if the bounded algorithm cannot find a sample, it returns an error.

How to use the calculator

  1. Paste a supported-profile schema without references or patterns.
  2. Choose member scope and provide default or enum for specific examples.
  3. Select “Process”; review the sample before using it in an isolated test.

Calculation details

Formula and calculation method

Try const, default and enum, anyOf alternatives, then type values. Strings use example or repeated x; numbers try zero and bounds; arrays have minItems or one item by default. Every returned candidate must meet all supported constraints.

Worked example

A schema with type: object, city as string, required: ["city"] and additionalProperties: false produces {"city":"example"}. Adding default: "Łódź" to city gives {"city":"Łódź"}. A default that fails type is skipped.

Limitations

  • Bounded JSON Schema 2020-12 profile: type (including type arrays), properties, required, additionalProperties, items, anyOf, enum, const, minimum, maximum, exclusiveMinimum, exclusiveMaximum, minLength/maxLength, minItems/maxItems and minProperties/maxProperties. title, description, default and examples are annotations. $schema may only identify https://json-schema.org/draft/2020-12/schema. Other keywords are rejected, not ignored.
  • Up to 50,000 UTF-16 units per field, 10,000 JSON values and 32 container levels; 256 schema nodes, 16 subschema levels, 64 properties/required/enum entries and 16 anyOf alternatives. A 100,000-operation budget applies. Numbers have up to 1,000 characters and exponents from −1000 to 1000. Duplicate member names and unpaired Unicode are rejected.
  • Up to 1,000 generated values, 100 items per array and 1,000 Unicode code points in a generated string. This is neither a random generator nor a complete schema solver. Failure does not prove unsatisfiability: provide a valid const, enum or default for difficult bounds. Names absent from the schema are not invented to meet minProperties.

Sources

Frequently asked questions

Is default always valid?

No. It is checked against the subschema rules before use; an invalid hint may be skipped.

Does no sample mean an invalid schema?

No. The bounded algorithm does not find every solution. Add an explicit valid example.

Is one sample enough for testing?

No. Separately test incorrect types, missing members, empty data, bounds and application rules.

Is my data uploaded?

Content and output are not sent to a server or analytics or saved in the URL or form history. Copying is a separate action. Reset cannot remove clipboard copies, printouts or extension data. Use anonymized examples.

Read the supporting guide

Generator

JSON Schema validator

Check JSON data against a declared 2020-12 schema profile without network references or data mutation.

Open tool
Generator

JSON to XML converter

Write JSON in a declared typed profile or reconstruct elements from an XML tree without guessing types.

Open tool
Generator

XML to JSON converter

Read the typed profile or ordinary XML as a tree retaining attributes, text and child order.

Open tool