JSON1

JSON1 / JSON Schema to JSON

JSON Schema to JSON

Generate a sample JSON document from a JSON Schema. Enums, defaults, and formats produce realistic values, and local $ref pointers are resolved.

Processed locally
InputJSON Schema
Ready
OutputJSON

Converted output appears here as you type.

Good to know

  • Local $ref pointers (#/…) are resolved; remote refs are not fetched.
  • Validation constraints such as pattern or minLength are not synthesised — the sample uses plain placeholders.

About this tool

The reverse direction: given a JSON Schema, produce one document that validates against it. The use is fixtures and mocks — a concrete example for documentation, a payload to seed a test, or a quick check that a schema you wrote admits what you meant it to admit.

Values are chosen deterministically. const wins, then the first enum entry, then default, then the first of examples; failing all of those, a placeholder follows the type — strings honour a recognised format like date-time or email, numbers take minimum if one is set, objects fill in every property, and arrays hold a single item.

How are $ref pointers handled?
Local pointers like #/definitions/Address and #/$defs/Address are resolved against the document itself. Remote refs are not fetched — nothing leaves the browser — so a schema that depends on one reports it as an error instead of silently guessing.
What about oneOf, anyOf, and allOf?
oneOf and anyOf take the first option, which is a valid choice by definition. allOf merges its branches when they all produce objects, the same way a validator intersects them.
Why does my pattern or minLength string not match?
Synthesising a string that satisfies an arbitrary regular expression is a problem of its own, and this tool does not attempt it — the sample uses plain placeholders. Treat the output as a structural skeleton and fill in constrained fields where the exact value matters.
What happens with a recursive schema?
The cycle is detected and the recursive branch comes out as null rather than looping forever. A linked-list schema, for example, produces a node whose next is null — one level of the structure, which is usually what a fixture needs.