YAML to JSON
Convert a YAML document into formatted JSON.
Loading tool…
About the yaml to json
Parses a YAML document and re-emits it as indented JSON. Anchors and aliases are resolved, multi-line scalars are folded according to their indicator, and a syntax error reports the line it was found on.
Frequently asked questions
Is every YAML file convertible to JSON?
Almost. YAML supports non-string mapping keys and multiple documents in one file, neither of which JSON has. Ordinary configuration files convert cleanly.
What happened to my comments?
JSON has no comment syntax, so they are dropped during parsing. If comments matter, keep YAML as the source of truth and generate JSON as a build artifact.