YAML to JSON Converter
Turn YAML into JSON, typically to feed a tool or API that only speaks JSON, or to find out what your YAML actually says.
This page opens with YAML as the input and JSON as the output.
The best way to audit a YAML file
Because JSON types are explicit, converting is the fastest way to discover that a value you believed was a string is a boolean, or that a version number lost a digit. If the JSON shows true where you wrote NO, the YAML was always wrong and you simply could not see it.
What does not survive
- Comments - JSON has nowhere to put them, so they are dropped permanently.
- Anchors and aliases - resolved and expanded, so shared structure becomes duplicated literal data.
- Multiple documents in one file - JSON has no equivalent of the --- separator.
- Non-string keys - legal in YAML, not in JSON.
Keep the original
Because comments and anchors are lost, a YAML to JSON to YAML round trip is not lossless. Convert to inspect or to feed a consumer, but keep editing the original file.
Use it to diff two configs
Two YAML files that differ only in key order and indentation produce a large, useless textual diff. Converting both to JSON normalises the representation so the diff shows only genuine changes.
It is also the quickest way to confirm that a refactor of a manifest changed nothing semantically, which is otherwise surprisingly hard to prove by reading.
Empty values become null
A YAML key with nothing after the colon is null, not an empty string. That distinction is invisible in the YAML and explicit in the JSON, which catches a surprising number of config bugs where a value was deleted rather than set.
An empty string has to be written with explicit quotes if that is what you meant.