JSON ⇄ YAML Converter
About JSON ⇄ YAML
The JSON to YAML converter translates between JSON and YAML in both directions. Convert a JSON config into readable, indentation-based YAML for a Kubernetes manifest or CI pipeline, or turn a YAML file back into strict JSON for a program that expects it.
The conversion runs entirely in your browser with no upload, so config files that hold secrets, hostnames or infrastructure details stay on your machine. It is free with no signup and no limits.
It is aimed at developers and DevOps engineers who move between the two formats constantly — writing YAML by hand but needing JSON for an API, or reading a JSON response but wanting the tidier YAML view.
How it works
JSON to YAML
Objects become key-value mappings and arrays become dash-prefixed lists, with two-space indentation showing the nesting. Strings are quoted only when necessary, producing the clean, minimal YAML people expect for config files.
YAML to JSON
Flip the direction with the swap control and paste YAML to get strict JSON back. Indentation-based structure, lists and scalars are parsed into the equivalent JSON objects, arrays and values.
Types and quoting
YAML has subtle scalar rules — bare true, yes or numeric-looking strings can be read as booleans or numbers. The converter follows standard YAML typing, and quotes values in the YAML output where leaving them bare would change their type.
Comment safety
JSON has no comment syntax, so converting YAML that contains # comments to JSON necessarily drops them — there is nowhere to put them. The converter preserves the data faithfully; only comments, which JSON cannot represent, are lost in that direction.
Frequently asked questions
Does converting to JSON keep my YAML comments?
No — JSON has no comment syntax, so comments are dropped when converting YAML to JSON. All data values are preserved; only the comments, which JSON cannot represent, are lost.
Why did an unquoted YAML value become a boolean or number?
YAML types bare scalars automatically, so yes, no, on, off and numeric-looking text can be read as booleans or numbers. Quote the value in your YAML to force it to stay a string.
How do I convert the other direction?
Use the swap control to flip between JSON to YAML and YAML to JSON without clearing your input.
Is my config uploaded to convert it?
No. The conversion is fully client-side, so YAML and JSON configs containing secrets never leave your browser.
Which indentation does the YAML output use?
Two-space indentation, the widely used convention for manifests and pipeline files.