JSON to YAML Converter
Paste JSON and get clean block-style YAML with two-space indents, quoting only strings a YAML parser would misread. Copy or download. Free, no sign-up.
Still loading. If the tool doesn’t appear, reload this page.
About this tool
JSON to YAML Converter
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.
How to use JSON to YAML Converter
Paste your JSON into the JSON input box, which starts with a sample object containing name, category, a features array and active: true
The YAML output panel converts on every keystroke, expanding nested objects and arrays in block style with two-space indents
If the JSON is invalid, the YAML output panel turns red and shows the JSON parser's error message instead, and the Copy button is disabled
Strings with YAML-significant characters such as a colon, hash or dash, or values like yes, null or 1.5 stored as text, are wrapped in double quotes
Click Copy to put the YAML on the clipboard; the button briefly reads Copied
Why use JSON to YAML Converter
Quotes only where it matters
Strings containing YAML-significant characters or edge whitespace are quoted; everything else stays unquoted and readable.
Block style, not flow style
Nested objects and lists are expanded across lines with two-space indents rather than collapsed into inline braces and brackets.
Errors surface as you type
The conversion re-runs on every keystroke and shows the JSON parser's own message the moment the input stops being valid.
Common use cases
- You exported a settings object as JSON and need it as YAML to drop into a docker-compose, GitHub Actions or Kubernetes manifest.
- A colleague pasted a JSON API example into a ticket and your docs use YAML code blocks, so you need the same data in the other notation.
- You are checking whether a string in your data — a timestamp, a version range, a value starting with a dash — needs quoting before it breaks the YAML parser.
Frequently asked questions
How many spaces does it indent?
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.
Link to answerWhy did some of my strings come out in quotes?
A string is quoted when it contains any of the YAML-significant characters : # { } [ ] , & * ? | - < > = ! % @ or a backtick, a quote or backslash, a line break or other control character, when it starts or ends with whitespace, or when it looks like another type (yes, no, null, a number such as 1.5, 0x1F or 007, or a date such as 2024-01-01). Without those quotes the parser would read the value as a mapping, comment, anchor, list item, number, date or boolean instead of text; quoted strings use JSON escapes such as \n.
Link to answerWhat happens to empty objects and arrays?
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.
Link to answerCan I convert a top-level JSON array?
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.
Link to answerEmbed this tool on your site
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>