Developer tool / 06
JSON to YAML Converter
Turn JSON into readable YAML for configuration files and manifests.
JSON to YAML Converter: TOEA writes the document as YAML with two-space indentation, quoting any value that would otherwise be misread and keeping long strings on a single line. Runs 100% locally in your browser with zero server file uploads.
- Category
- Developer tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Up to 5 MB · nothing is uploaded
When another program reads the YAML
A string is quoted whenever a YAML 1.1 or 1.2 reader could take it for something else. That covers yes, no, on, and off in any case, the single letters y and n, null and ~, numbers with leading zeros such as 0123, hex and octal forms, and dates and times such as 2024-01-05 or 12:30. PyYAML, which many Python tools and Ansible use, would otherwise read on as true and 0123 as the octal number 83. JSON numbers, booleans, and null stay unquoted, so their types survive.
Tidying the output for people
Keys keep the order they had in the JSON, apart from keys that are whole numbers, so put the fields a reader looks for first, such as name, image, or version, at the top of each object before converting. Comments can be added after conversion with #; they survive editing but not another trip through JSON. Indentation is two spaces throughout, and a YAML file must never be indented with tabs, so keep that setting in your editor when changing the result.
Many tools that read YAML also accept JSON directly, since JSON is valid YAML 1.2. Converting is for readability and comments, not compatibility.
How to use it
- Paste JSON or choose a file.
- Check the YAML.
- Copy or download it.
Privacy & limitations
The text is converted in your browser and never uploaded, which matters when the file is a config or an export you would rather not hand to a stranger. Values are quoted where needed so the output parses back to exactly what went in.
Related tools
Frequently asked questions
Why are some values quoted?
A string containing a colon, or one that a YAML 1.1 or 1.2 reader would take for a number, boolean, null, or date (yes, off, 0123, 2024-01-05), is quoted so it reads back as the same string.
Why are long URLs not wrapped?
Line folding is valid YAML but surprising in a file people edit by hand, so it is turned off and long values stay on one line.
Will it round-trip?
Yes. Converting back through the YAML to JSON tool returns the original document, which is what the tests check.
Can I get comments in the output?
No. The source JSON has none to carry across, so the result is comment-free.
Free tool · runs in your browser · no account required