How to Convert JSON to YAML
JSON runs APIs; YAML runs configuration. Kubernetes manifests, CI pipelines, Docker Compose files, and countless app configs are written in YAML because it is easier for humans to read and write. When you have data as JSON but need it as a config, converting to YAML saves you a tedious manual rewrite. This guide explains the difference between the two, what the conversion preserves, and the YAML quirks to watch for.
JSON vs. YAML — same data, different style
JSON and YAML represent the same kinds of structure — objects, arrays, strings, numbers, booleans — so they convert cleanly in both directions. The difference is presentation:
- JSON uses braces, brackets, and quotes. Compact, strict, machine-friendly.
- YAML uses indentation and dashes instead of punctuation. Cleaner to read, supports comments, preferred for files humans edit by hand.
Because the underlying data model matches, converting is lossless for normal content.
How to convert JSON to YAML with this tool
- Open the JSON to YAML tool.
- Paste your JSON.
- Convert to YAML.
- Copy the result into your config file.
Everything runs in your browser, so configs containing secrets or internal details are never uploaded.
YAML quirks to know
YAML's readability comes with its own sharp edges:
- Indentation is significant. YAML uses spaces (never tabs) to show structure. Get the indentation wrong and the meaning changes or the file fails to parse.
- The "Norway problem." Unquoted `no`, `yes`, `on`, `off`, `true`, and `false` are read as booleans. A country code list with `NO` for Norway can turn into `false`. Quote strings that could be misread.
- Numbers vs. strings. A value like `1.0` or `007` may be interpreted as a number, dropping the trailing zero or leading zeros. Quote it to keep it as text.
A good converter handles quoting, but it is worth scanning the output for these cases.
Validate before you convert
Convert only valid JSON. If yours might be malformed, check it with JSON Validator and tidy it with JSON Formatter first. Garbage in, garbage out.
The reverse trip
To turn a YAML config back into JSON for an API or code, YAML to JSON does the opposite conversion.
Common uses
- Write Kubernetes, Docker, or CI configs from JSON data.
- Convert an API response into a readable config format.
- Move settings between systems that prefer different formats.
Privacy and limits
Conversion is fully local — no upload, no size limit, nothing stored, offline once loaded. Open the JSON to YAML tool to turn data into config.
Try the tool
Open JSON to YAML →