Documenting an API's shape
Paste a representative response and get a schema draft. Then trim the required list and add formats and ranges.
Generate a JSON Schema from a sample document in your browser, inferring types and required fields.
Maintained by Roshan.
Converts json sample to json schema in this tab, with nothing sent anywhere.
Find related browser-local tools for nearby tasks without starting another search.
Browse all generatorsJSON Schema is how you describe and validate the shape of JSON - what fields exist, what types they hold, which are required - and writing one by hand from scratch is laborious. Generating a draft from an example document gives you a running start: paste a representative sample, and get a schema that matches it. This infers the type of every value, distinguishes an integer from a decimal where the sample makes that clear, and lists the fields present as required, producing a valid draft 2020-12 schema. It is a starting point rather than a finished contract - a real schema usually needs constraints the sample cannot imply, such as string formats, number ranges, or which fields are genuinely optional - but it removes the tedium of typing out the structure and leaves you to add the rules that matter.
Paste a representative response and get a schema draft. Then trim the required list and add formats and ranges.
Generate the schema from sample data, then tighten it with the constraints your validation needs to enforce.
JSON Schema draft 2020-12, with the schema declaration included in the output.
Because the sample contains every field. Remove from the required list the fields that are genuinely optional.
No. A sample cannot imply those. Add string formats, number ranges and patterns yourself.
Yes, where the sample shows a whole number it uses 'integer'; a decimal uses 'number'.
Generate TypeScript interfaces from a JSON sample in your browser. Nested objects become their own interfaces.
Format, minify, and validate JSON locally in your browser. Inspect keys, values, nesting depth, and root type without sending private API data to a server.
Generate Go structs from a JSON sample in your browser, complete with json struct tags.