JSON Schema generator
Paste sample data (JSON, YAML, TOML, XML, CSV, Protocol Buffers text or a query result) and get a JSON Schema for it below: the type of each value, the properties of objects and the keys every sample has.
From samples to a schema
A list of objects gives one schema for its items: properties found in any of them, required only when every item has them; a property that is sometimes null becomes ["string", "null"]. Strings that clearly are dates, times, email addresses, UUIDs or web addresses get a format. Several documents (JSON Lines, YAML documents) are samples of the same value.
Then tighten it, and test
The schema is a starting point: Use as text puts it in the editor, where it shows the test box below it, to add limits and patterns and try values against them.
Copy, download or keep editing
The schema follows your typing, and a mistake in what you paste is pointed out first, with its line and column. Copy or Download take the schema as it is; Use as text puts it in the editor in place of what you pasted (Ctrl+Z goes back).
Private: nothing is uploaded
Formatting, checking and comparing all happen in your browser. Your documents are saved in the browser's own storage on this computer, not on a server, so they never leave your device.
With your permission, we count anonymous visits (which pages and tools are used), never what you type. See Privacy.
Questions
Which draft is the schema?
JSON Schema 2020-12, with its "$schema" written at the top.
Can I make a schema from CSV?
Yes: the header row names the properties, and numbers and true / false are recognised.
Is my data uploaded anywhere?
Your documents aren't: everything runs in your browser, and they are saved on your computer, in the browser's storage for this site. With your permission we count anonymous visits, never their content.
More tools
- Formatter & Converter for JSON, YAML, XML, SQL
- JSON to YAML Converter
- YAML to JSON Converter
- JSON to TOML Converter
- TOML to JSON Converter
- CSV to JSON Converter
- JSON to CSV Converter
- XML to JSON Converter
- JSON to XML Converter
- Free Online Diagram Maker & Editor
- Crypto Tools: Passwords, Keys, Hashes & JWTs
- Timestamp, Cron, Regex & UUID Utilities