JSON to YAML Converter
Many infrastructure tools read YAML while generated configs and API exports arrive as JSON. Paste JSON on the left and the YAML appears on the right, for Kubernetes manifests, CI pipelines or Docker Compose files. Choose a two or four space indent, sort keys so diffs stay small, then copy the result or download it as config.yml. Strings that YAML 1.1 loaders would read as booleans, numbers or dates are quoted for you. The conversion runs in your browser, so the JSON is never uploaded.
How to Convert JSON to YAML
- Paste JSON into JSON Input; the YAML Output updates 300 ms after you stop typing, up to 100 KB. Longer input waits for Convert, and the old output is cleared
- Set Indent to 2 or 4 spaces, and tick or clear Sort keys and Force quotes
- Click Convert JSON to YAML to convert at once, to convert input over 100 KB (up to 500 KB), or to see an empty-input message
- Use Copy YAML or Download .yml to save
config.yml
Why YAML quoting and large numbers need care
Sorted keys make diffs readable. Sort keys orders every object's keys alphabetically, at every depth, so two exports of the same data produce the same text. Turn it off to keep the key order from your JSON. Indentation carries structure in YAML, so the indent setting changes every nested line, not just the look.
YAML 1.1 reads plain words as other types. Older loaders such as PyYAML treat on, yes and y as booleans, 014 as octal and 2001-12-14 as a date. The converter quotes those strings automatically, so Force quotes is optional: it simply quotes every string value, and leaves keys as they are.
JSON numbers are doubles. The page parses your JSON with JSON.parse, so a number the double format cannot hold changes: 9007199254740993 becomes 9007199254740992, 1e400 becomes .inf and 1e-400 becomes 0. The tool compares each number as written with the number the YAML will show, and names those that differ. That includes large integers the double holds exactly but prints differently: 18446744073709551616 comes out as 18446744073709552000. Keep IDs as strings in the JSON if every digit matters.