Free JSON formatter and validator with YAML conversion. Pretty-print or minify any JSON, validate it, and convert between JSON and YAML in either direction. Also a JSON beautifier and YAML formatter for engineers who need both in one place.
Pretty-printing re-indents JSON so its nesting is readable, and minifying strips every space and newline to shrink a payload for transport. Both are lossless: they change only whitespace, never the data. Validation is the useful part, because JSON is strict. Keys must be double-quoted, strings cannot use single quotes, trailing commas are not allowed, and comments are not part of the format. This tool reports the exact point where parsing fails so you can find a stray comma or an unquoted key quickly.
Everything runs in your browser, so you can paste config, an API response, or a log line without sending it anywhere. Use the pretty-print view to inspect an unfamiliar response and the minify view to produce a compact string for a query parameter or an environment variable.
YAML is a near-superset of JSON aimed at human editing: it uses indentation instead of braces, allows comments with #, and can reuse values with anchors and aliases. Because valid JSON is also valid YAML, converting JSON to YAML is straightforward, and this tool goes both directions so you can move config between a service that wants JSON and one that wants YAML.
Watch two gotchas when converting. Comments and anchors have no equivalent in JSON, so they are lost on the way from YAML to JSON. And YAML is whitespace-sensitive: a value like on, no, or a leading-zero number can be read as a boolean or a different type unless it is quoted, which is a classic source of surprising config bugs.
JSON uses braces and brackets and is strict about quoting and commas, which makes it ideal for machines and APIs. YAML uses indentation, allows comments, and is easier to hand-edit. Most valid JSON is also valid YAML, so the two convert cleanly.
Paste it into the tool and it parses the text with a strict JSON parser. If the syntax is valid it formats the output; if not, it reports where parsing failed so you can fix the offending character.
In practice yes. YAML 1.2 was designed so that any valid JSON document is also valid YAML, which is why JSON can be dropped straight into a YAML file and why converting JSON to YAML is lossless.
The usual causes are trailing commas after the last item, single quotes instead of double quotes, unquoted keys, or comments, none of which JSON allows. The tool points to the position of the error so you can correct it.