JSON Beautifier
Format JSON with clean indentation and line breaks so it's easy to read.
Turn example JSON into a JSON Schema in one step, then check other data against it. Merge several samples for a more accurate schema, with formats, required keys and nullable fields detected.
How it works
Paste example JSON, or several examples one per line, or load a sample.
Choose the draft and options such as required keys and closed objects.
Copy or download the schema, and validate other JSON against it below.
About this tool
JSON Schema describes the shape of JSON data: which keys exist, their types, which are required and what formats strings follow. It's used to validate API requests and responses, document APIs with OpenAPI, check configuration files, and define structured outputs for AI models so their answers come back in a predictable shape.
Writing a schema by hand for a large object is slow and error-prone. This generator infers it from real examples: nested objects and arrays become nested schemas, array items of different shapes are merged, mixed types become type lists, and keys that only appear in some samples are left optional. Strings that look like dates, emails, URLs or UUIDs get a format. Review the result and tighten it where you know more than the samples show.
Paste several examples to learn which keys are optional and which types vary.
Choose the draft your validator or API tooling expects.
Recognises date-time, date, email, URI, UUID and IPv4 strings.
Check any JSON against the schema with clear error paths.
FAQ
Use Draft 2020-12 for new projects; it's the current version and used by OpenAPI 3.1. Choose Draft 7 for older tools that don't support 2020-12.
With “Always present”, a key is required if it appears in every sample. Paste several varied samples for the most accurate result, or choose None to make everything optional.
Yes, as a starting point. Providers support a subset of JSON Schema for structured outputs and often need every key required and additionalProperties set to false, so check your provider's documentation.
Ajv, the most widely used JavaScript JSON Schema validator, with format checking enabled.
No. Everything you type is processed in your browser and never leaves your device. Drafts are saved only in this browser's local storage so you can come back to them.
Missing something?
Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.