Developer 🔒 Runs in your browser — no data sent to servers

JSON Schema Generator

Create a JSON Schema from a sample document.

Generate a JSON Schema from a Sample

A JSON Schema lets any language validate data against the same rules. This page opens JSON to Types with JSON Schema chosen, as a starting point you can refine.

Nullable values

A field that is null in one sample and a string in another gets "type": ["string", "null"], the standard way to allow both.

Related tools

To check the sample is valid JSON first, use the JSON formatter. For typed code instead of a schema, see JSON to TypeScript.

Guides