61 chars · 1 line
Waiting for input
61 chars · 1 line
Waiting for input
JSON to YAML conversion guide
Paste valid JSON into the converter above to serialize objects, arrays, numbers, booleans, strings, and null values as readable YAML. The conversion is useful when configuration starts as JSON but a deployment or developer workflow expects YAML. This tool is free to use. No account or payment is required.
Last updated
The converter uses standard JSON parsing first. Comments, trailing commas, single-quoted strings, undefined, and other JavaScript-only syntax must be corrected before the data can be serialized as YAML.
After parsing succeeds, the resulting data value is serialized with readable YAML indentation.
JSON and YAML can represent the same common objects, arrays, strings, numbers, booleans, and null values. The YAML result is often more comfortable for configuration that people edit directly.
JSON does not carry comments, anchors, aliases, or other YAML source features, so the converter cannot invent them. Add YAML-specific documentation only after reviewing the generated file.
A JSON object with an array becomes a YAML mapping with a block sequence.
{"service":{"name":"api","ports":[8080,8081],"enabled":true}}service:
name: api
ports:
- 8080
- 8081
enabled: trueCommon questions
The parsed JavaScript object is serialized in its property iteration order; the converter does not alphabetically sort keys.
No. The input must first be valid standard JSON because JSON parsing happens before YAML serialization.
No. JSON parsing and YAML serialization run locally in your browser.
Debugging a specific YAML issue? Browse YAML troubleshooting.