YAML Converter
Two-way YAML ↔ JSON translation, instantly.
{
"name": "devtools",
"version": "0.1.0",
"tools": [
"json-formatter",
"uuid-generator"
],
"meta": {
"free": true,
"signup": false
}
}How to use the YAML Converter
YAML is the format of choice for Kubernetes manifests, GitHub Actions, Ansible and most cloud-native config. JSON is the format every programming language speaks natively. This tool converts between them in either direction, with js-yaml doing the heavy lifting and live error messages when your input is malformed.
- 01Pick a direction with the toggle: yaml → json or json → yaml.
- 02Paste your input into the left panel.
- 03Copy the result from the right panel. Errors show inline with the parser's original message.
tips
- —YAML is a superset of JSON — every valid JSON document is also valid YAML. The reverse is not true: anchors (
&anchor), multi-document streams (---) and block scalars have no JSON equivalent. - —Tabs are illegal for indentation in YAML — use spaces. The parser will reject the whole document otherwise, even if a single line is wrong.
- —Round-tripping YAML → JSON → YAML drops comments and may reorder keys. If you need to preserve formatting, edit the YAML directly instead of converting back and forth.
frequently asked
Why does the YAML output use multi-line strings sometimes and quoted strings other times?+
js-yaml (and the YAML spec) chooses the most readable representation: plain scalars when the value is unambiguous, quotes when it could be confused with a number or boolean, and block scalars for text with embedded newlines. The output is always valid YAML.
Can I convert a Kubernetes manifest?+
Yes. Multi-document YAML (separated by ---) is supported on the YAML → JSON direction and returned as an array. JSON → YAML emits a single document; split your input first if you need several.
What happens to YAML comments?+
Comments are dropped during parsing — they are not part of the data model. If preserving comments matters (e.g. for config templates), edit the YAML by hand instead of round-tripping through JSON.