About this tool
Convert JSON objects and arrays into readable YAML.
The JSON to YAML Converter rewrites a JSON object or array as block-style YAML, using two spaces per nesting level and quoting only the strings that would otherwise be misread by a YAML parser. Values that contain characters like a colon, hash, dash or brace, or that begin or end with a space, are wrapped in double quotes; numbers, booleans and null are left bare. It is for anyone hand-editing a config that wants YAML but whose source of truth arrived as JSON.
Open JSON to YAML Converter on AltFTool — it loads instantly in your browser.
Paste your code or data sample into the workspace.
Pick the format, conversion, or analysis you need.
Copy the polished result straight back into your project.
Strings containing YAML-significant characters or edge whitespace are quoted; everything else stays unquoted and readable.
Nested objects and lists are expanded across lines with two-space indents rather than collapsed into inline braces and brackets.
The conversion re-runs on every keystroke and shows the JSON parser's own message the moment the input stops being valid.
Two spaces per level, which is the conventional YAML indent and the one used by Kubernetes, GitHub Actions and docker-compose examples. Tabs are never emitted, since the YAML spec forbids them for indentation.
A string is quoted when it contains any of the YAML-significant characters : # { } [ ] , & * ? | - < > = ! % @ or a backtick, or when it starts or ends with whitespace. Without those quotes the parser would read the value as a mapping, comment, anchor or list item instead of text.
An empty object is written as {} and an empty array as [], the flow-style forms, because block style has no way to express a container with nothing in it. An empty string becomes a pair of double quotes.
Yes — a top-level array becomes a sequence of dash-prefixed entries, and any object inside it is expanded on the lines below its dash. Scalars, objects and arrays can be mixed within the same list.
Add the JSON to YAML Converter widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/json-to-yaml-converter"
title="JSON to YAML Converter — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/json-to-yaml-converter?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>