YAML to JSON
For the common subset — config files, not the whole spec.
Everything is processed in this tab. Nothing you paste is sent anywhere.
Every tool runs entirely in your browser. Your files are never uploaded to a server.
YAML and JSON describe the same data. YAML uses indentation and JSON uses braces, so converting means reading the indentation structure and writing it as nested objects and arrays.
How to use YAML to JSON Converter
- Paste your YAML. Comments and document markers are ignored.
- Read the JSON. Indented by default; the toggle produces a single line.
About converting YAML to JSON
YAML and JSON are two notations for the same underlying data model: scalars, ordered sequences and key-value mappings. JSON marks structure with braces and brackets, which makes it unambiguous and tedious to write by hand. YAML marks structure with indentation, which makes it pleasant to write and gives it an entire category of failure JSON does not have. Indentation-significant syntax means whitespace carries meaning, so a line indented two spaces instead of four changes what the document says rather than how it looks. This is why tabs are forbidden outright — a tab has no defined width, so the same file would parse differently depending on the editor. An editor configured to convert spaces to tabs on save will break a YAML file silently and produce an error that appears to be about something else. The other classic trap is implicit typing. YAML infers types from unquoted values, and in the widely implemented 1.1 revision the words yes, no, on and off are booleans. A list of country codes containing NO therefore becomes false, which is well known enough to have a name. Version 1.2 removed those aliases, but plenty of parsers still behave the old way, so quoting anything that could be mistaken for a boolean or a number remains sound practice — particularly version strings, where an unquoted 1.10 becomes the number 1.1.
Frequently asked questions
Why does YAML reject tabs?
Is every YAML file valid JSON input?
What is the Norway problem?
Does this handle the whole YAML specification?
Is my configuration uploaded anywhere?
Last updated