YAML to JSON
Convert YAML into JSON, with indentation errors reported by line.
Runs in your browser — nothing you type is sent anywhere
Parsed with the JSON-compatible schema, which refuses the YAML tags that amount to arbitrary object construction — so pasting a document from somewhere you do not control is safe.
JSON
The result appears here as you type. Nothing is sent anywhere — the work happens in this page.
About the YAML to JSON
Most configuration is written in YAML and most tooling consumes JSON, so this conversion happens constantly — usually when you want to feed a config file into something that only speaks JSON, or when you need to check what a YAML document actually parses to.
That second case is the more useful one, because YAML has a reputation for surprising people. Indentation defines structure, tabs are forbidden entirely, and a value that looks like text can be read as something else: the word no becomes a boolean in older YAML versions, and a version number like 1.10 becomes the number 1.1. Converting to JSON shows you exactly what the parser saw rather than what you meant.
Errors are reported with a line number, because an indentation mistake several levels deep is otherwise very hard to find. The message is trimmed to one readable line rather than the multi-line excerpt the parser produces by default.
Parsing uses the JSON-compatible schema, which refuses the YAML tags that amount to arbitrary object construction. That distinction matters if you are pasting a document from somewhere you do not control — the permissive schema is a genuine security problem in some YAML libraries, and there is no reason to accept those constructs here.
Everything runs in your browser, so nothing you paste is transmitted.
How to use the YAML to JSON
Paste your YAML
A config file, a snippet, or a whole document. Conversion happens as you type with nothing to submit.
Read the JSON
The result shows exactly what the parser understood, which is the quickest way to spot a value being read as the wrong type.
Fix any error by line
An invalid document reports the line it failed on, which is usually an indentation problem or a stray tab.
Copy or download
Copy the JSON, or download it as a .json file. You can minify it first if it is going into a request body.
Frequently asked questions
Why does my YAML fail with an indentation error?
Why did my value become a boolean or a number?
Is it safe to paste a YAML file I did not write?
Can it handle a file with several documents in it?
Are comments preserved?
You may also need
JSON to YAML
Convert JSON into readable YAML for a config file, with optional key sorting.
JSON Formatter
Format, validate and minify JSON — with the exact line and column of any error.
JSON to CSV
Turn an array of JSON objects into a spreadsheet-ready CSV, nested fields included.
XML to JSON
Convert an XML document or API response into JSON you can work with.