JSON Formatter
Pretty-print and validate JSON, with the exact line and column of any error.
Convert YAML into JSON and JSON back into YAML.
YAML to JSON converts between the two formats configuration lives in. YAML is pleasant to write and unforgiving about indentation; JSON is noisy to write and completely unambiguous. Moving between them is a daily job for anyone working with CI pipelines, Kubernetes manifests or application config.
The parser covers the YAML that appears in real configuration files: nested maps and sequences, quoted and unquoted scalars, block scalars with the pipe and greater-than indicators, inline flow collections, comments, multiple documents separated by three dashes, and the usual scalar types including booleans, nulls, integers and floats.
It does not implement the full YAML specification, which is substantially larger than most people realise and includes features such as anchors, aliases, merge keys and custom tags. Those are reported clearly rather than being misread, so you are told what is unsupported instead of receiving quietly wrong output.
The yaml to json converter is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
Because YAML uses indentation for structure and forbids tabs entirely. A single tab anywhere in the file, or a line indented by an amount that does not match its siblings, makes the document invalid. The error names the line.
Anchors and aliases, merge keys, custom tags and a few rarer constructs. They are detected and reported rather than guessed at, because misreading configuration is worse than refusing it.
The strings true and false become booleans, as do yes and no, which is a long-standing YAML quirk that surprises people. If you need the literal word yes as a string, quote it.
They are discarded, because JSON has no comment syntax. Converting back therefore does not restore them, which is worth knowing before using a round trip as an editing workflow.
Yes. Keys needing quotes are quoted, strings that would be read as another type are quoted, and nesting is indented consistently.
No. Parsing runs in your browser, which matters because configuration files frequently contain internal hostnames and secrets.
If the yaml to json converter is not quite what you need, these other free tools solve closely related problems.
Pretty-print and validate JSON, with the exact line and column of any error.
Pretty-print XML with proper indentation, and catch malformed documents.
Turn spreadsheet data into JSON, or JSON records back into CSV rows.
Strip whitespace from JSON and compare original and minified sizes.
Generate cron expressions from a schedule, and explain ones you already have.