Convert JSON to YAML
Convert JSON into readable YAML for configuration files.
JSON to YAML Converter
Developer tool running locally in browser
What does JSON to YAML Converter do?
Convert JSON to YAML with proper indentation, quoting only where it is needed, and correct handling of multi-line strings. Ideal for turning an API payload into a Kubernetes manifest, CI configuration or Docker Compose file.
How to Use JSON to YAML Converter
- 1Paste your JSONIt is validated first.
- 2Set the indentationTwo spaces is the YAML norm.
- 3Copy the YAMLReady for your config file.
Key Features
- Configurable indentation, defaulting to the conventional two spaces
- Quotes applied only where YAML requires them
- Multi-line strings emitted as block scalars for readability
- Validates the JSON before converting
- Round-trips cleanly back through the YAML to JSON tool
Frequently Asked Questions
Is YAML a superset of JSON?
Yes, since YAML 1.2 — every valid JSON document is also valid YAML. The converse is not true, because YAML adds anchors, comments, multiple documents and several scalar styles.
Why do some strings get quoted and others not?
YAML only needs quotes when a value would otherwise be ambiguous — strings like "yes", "null", "1.0" or anything starting with a special character. The converter quotes exactly those and leaves the rest clean.
What is the Norway problem?
In YAML 1.1, the unquoted value "NO" parses as boolean false — so a country list containing Norway breaks. YAML 1.2 fixed it, but many parsers still use 1.1 rules, which is why this converter quotes such values.
Does it preserve key order?
Yes. Keys appear in the same order as the source JSON, which keeps diffs readable when you regenerate a config file.
Input is processed in your browser and never transmitted. That said, treat any web page as untrusted for live production secrets — rotate anything you paste anywhere.
Related Tools
YAML to JSON Converter
Convert YAML configuration into JSON.
YAML Formatter
Tidy and validate YAML with consistent indentation.
JSON Formatter
Format, validate and explore JSON with precise error reporting.
JSON Validator
Check whether JSON is valid and get the exact error position.
