About the JSON to YAML Converter tool
Kubernetes manifests, Docker Compose files, GitHub Actions workflows, OpenAPI specs and Ansible playbooks are all written in YAML, yet the data you start from is often JSON from an API, a generator or another tool. This converter turns JSON into clean, human-friendly YAML instantly, without brackets, braces or quotes getting in the way.
The conversion is done with js-yaml, a widely used YAML library. Strings that would be misread in YAML, such as “yes”, “1.10” or dates, are quoted automatically so they stay strings, and multi-line text is written as a readable block. You can choose 2 or 4 space indentation, sort keys alphabetically to make diffs easier to review, and decide whether long strings should be folded at 80 characters or kept on one line. JSON syntax errors are reported with their line and column so you can fix the input quickly.
Everything runs in your browser, so internal configuration, secrets placeholders and infrastructure details never leave your machine. Output updates live as you type, and you can download it as a ready-to-use .yaml file.
How to use JSON to YAML Converter
- Paste JSON into the “JSON input” box, open a .json file with “Open file”, or click “Load sample”.
- Choose the “YAML indent”: 2 or 4 spaces.
- Turn on “Sort keys A–Z” or “Wrap long strings at 80” if you need them.
- Watch the YAML output update as you type; JSON errors show the exact line and column.
- Click “Copy” or “Download” to save a .yaml file.
Features
Accurate conversion
Powered by js-yaml, so the output is valid YAML that parses back to the same data.
Safe quoting
Ambiguous strings like yes, no, 1.10 or dates are quoted so they keep their meaning.
Indent and sort options
Pick 2 or 4 spaces and optionally sort keys for tidy, diff-friendly files.
Readable multi-line text
Strings with line breaks become YAML block scalars instead of escaped \n.
Helpful errors
Invalid JSON is highlighted with line and column numbers.
When to use it
- Turn a JSON Kubernetes object from kubectl into a YAML manifest.
- Convert an OpenAPI or Swagger spec from JSON to YAML for easier editing.
- Write Docker Compose or GitHub Actions config from JSON generated by a script.
- Make large JSON config files easier to read and comment.
- Prepare YAML test fixtures and translation files.
Frequently asked questions
Is YAML a superset of JSON?
Almost. Most JSON is also valid YAML, but converting to proper block-style YAML makes the file far easier to read and edit by hand.
Why are some of my strings in quotes?
Values such as “yes”, “on”, “1.10” or “2024-01-01” could be read as booleans, numbers or dates by some YAML parsers, so they are quoted to keep them as strings.
Does the key order change?
No, keys keep their original order unless you switch on “Sort keys A–Z”.
Can I add comments to the YAML?
JSON has no comments, so the output has none either, but you can add your own # comments after downloading.
Is the conversion done on a server?
No. It runs in your browser with the js-yaml library, and your data stays on your device.
Can I convert YAML back to JSON?
Yes. Use the YAML to JSON converter on this site, which also validates your YAML and points to the line of any error.