How to convert JSON to YAML
- Paste JSON or open a
.jsonfile. The YAML updates as you type. - Choose an Indent of 2 or 4 spaces.
- Press ⇄ to check the round trip in YAML to JSON.
Invalid JSON shows its line and column instead; common JSON errors covers the usual causes.
Example: an app config
{"service":"geo-lookup","country":"NO","cache":"off","version":"1.10","port":"8080","launch":"2026-11-05","motd":"Maintenance at 02:00.\nExpect 5 minutes of downtime.\n","regions":["eu-north-1","eu-west-1"],"limits":{"rps":50,"burst":200}}
service: geo-lookup
country: "NO"
cache: "off"
version: "1.10"
port: "8080"
launch: "2026-11-05"
motd: |
Maintenance at 02:00.
Expect 5 minutes of downtime.
regions:
- eu-north-1
- eu-west-1
limits:
rps: 50
burst: 200
What gets quoted
A string is quoted when any YAML parser could read it as something else: numbers such as "1.10" and "8080", "true", "null", empty strings, text containing : , and the values YAML 1.1 parsers misread, like yes, no, on, off and dates. So country: "NO" stays a country code in PyYAML and older Kubernetes tooling. Multi-line text becomes a | block, which keeps every line break. Long lines are not folded. To check a file by hand, use the YAML validator.
For pyproject.toml, Cargo.toml or a Hugo config, use JSON to TOML instead.