JSON to YAML and YAML to JSON converter
About JSON ⇄ YAML
The JSON to YAML converter works in both directions. Turn a JSON config into YAML for a Kubernetes manifest or CI pipeline, or turn a YAML file back into strict JSON for a program that expects it.
Use the swap control to change direction without clearing your input. Runs in your browser. Nothing is uploaded.
How it works
JSON to YAML
Objects become key-value mappings and arrays become lists with a leading dash. Nesting uses two-space indentation. Strings are quoted only when they need it.
YAML to JSON
Flip the direction and paste YAML to get pretty-printed JSON. Mappings, lists and scalars become the matching JSON objects, arrays and values.
Types and quoting
YAML reads bare scalars by type, so true, null and 123 are not strings. The converter follows YAML 1.2 typing. When writing YAML, it quotes strings like "true" or "123" so they stay strings.
Comments in YAML to JSON
JSON has no comment syntax, so # comments are dropped when you convert YAML to JSON. All the data is kept.
Frequently asked questions
Does converting to JSON keep my YAML comments?
No. JSON has no comment syntax, so comments are dropped. All data values are kept.
Why did an unquoted YAML value become a boolean or number?
YAML types bare scalars, so true, false, null and numeric-looking text are read as booleans, null or numbers. Quote the value in your YAML to keep it a string.
How do I convert the other direction?
Use the swap control to switch between JSON to YAML and YAML to JSON. Your input stays in place.
Is my config uploaded to convert it?
No. The conversion runs in your browser.
Which indentation does the YAML output use?
Two spaces, the usual convention for manifests and pipeline files.
Sources & last verified
We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.
Found a wrong result or an outdated claim? Report an error and we will check it again.