How to Convert YAML to JSON
YAML and JSON describe the same kinds of data in very different styles. YAML is written for people — indentation instead of brackets, comments allowed, less punctuation. JSON is written for machines, and is what most APIs and tools actually consume. Converting between them is a routine part of working with configuration, and doing it here shows you the result immediately, with a line number when the YAML will not parse.
Choose a direction
YAML to JSON, or the reverse. Loading a file picks the direction automatically from its extension.
Paste or load your file
Nesting, sequences, block scalars, inline collections and multi-document files are all handled.
Copy the result
Take it to your clipboard or download it. Send the output back to the input to convert again.
The Things YAML Gets Wrong Quietly
Tabs are illegal. YAML forbids them for indentation entirely, and because a tab and some spaces look identical in most editors, this produces one of the most baffling errors in configuration work. If a file that looks perfectly aligned refuses to parse, this is almost always why.
Unquoted values get interpreted. Writing version: 1.20 gives you the number 1.2, which is not the same version. no and off become false — the famous case being country code NO for Norway. This converter only treats a value as a number when the round trip is exact, which protects version strings and leading-zero identifiers, but quoting anything that must stay a string remains the right habit.
JSON is valid YAML.The YAML specification is a superset, which is why you can paste JSON into a YAML file and it works. The reverse is not true — comments, anchors and multiple documents in one file have no JSON equivalent, and comments in particular are simply lost in conversion.
Common Situations This Tool Solves
Feeding a config file to an API
Kubernetes, CI pipelines and Docker Compose are all YAML, while the APIs behind them speak JSON. Converting is often the missing step.
Checking that YAML is valid
Indentation errors are hard to see. If the JSON comes out, the YAML parsed - and if not, you get the line number.
Making JSON readable for humans
Converting to YAML strips the brackets and quotes, which makes a deeply nested config far easier to review.
Understanding what a value became
Seeing your YAML as JSON shows exactly what each value was interpreted as, which catches the number-and-boolean surprises early.
Frequently Asked Questions
How do I convert YAML to JSON for free?
Paste your YAML and the JSON appears immediately. Free, no signup, and nothing is uploaded.
Is my configuration uploaded to a server?
No. Parsing happens entirely in your browser, which matters because config files often contain hostnames and credentials.
Why does my YAML fail to parse?
Most often tabs used for indentation, which YAML forbids. The error message includes the line number.
Does it support nested structures?
Yes, at any depth, along with sequences, inline collections and block scalars for multi-line strings.
What happens to my comments?
They are discarded. JSON has no comment syntax, so there is nowhere for them to go.
Why did my version number change?
YAML reads unquoted 1.20 as the number 1.2. Quote anything that must remain a string.
Can it handle multiple documents in one file?
Yes. Documents separated by three hyphens become a JSON array, one entry per document.
Is JSON valid YAML?
Yes. YAML is a superset of JSON, so any valid JSON is also valid YAML - but not the other way round.
Does it support anchors and aliases?
Not currently. Those are among the more advanced parts of the specification and rarely appear in everyday config files.
Can I convert JSON back to YAML?
Yes, switch the direction at the top. Strings that would be misread are quoted automatically.
Is there a file size limit?
Files above 5 MB are rejected because browser parsing becomes slow.
Is this YAML converter really free?
Completely free, with no limits, no signup and no premium wall.
Last updated: July 21, 2026 · FlipMyFormat YAML to JSON
Written and maintained by the FlipMyFormat team
