How to use JSON to YAML
- 1. Paste JSON. A single object or array. Invalid JSON shows a parse error.
- 2. Confirm JSON → YAML. Source JSON, target YAML.
- 3. Copy YAML. Re-indent if your linter wants two spaces.
About this tool
“JSON to yaml” is the direction CI templates and Helm wrappers need when an API already speaks JSON. The hub tool can also emit TOML; this page is only the JSON → YAML pair.
Pretty maps vs JSON keys
Key order follows the JSON object as parsed by the engine. Duplicate keys are invalid JSON and will fail before conversion.
When to stay on JSON
If the consumer is JavaScript, leave it as JSON. Convert to YAML when humans will edit the file in git.
Code examples
Node
import { parse } from "yaml";
parse("name: Ada");