Convert YAML to JSON
More data converters: JSON to Excel · JSON to CSV · CSV to JSON · Excel to JSON · XML to JSON · JSON to XML · XML to Excel · JSON Formatter
How to Convert YAML to JSON
A .yaml or .yml file, or several documents separated by ---.
If the YAML is not valid, the message shows the line and column — usually an indentation problem.
Choose the indentation, then copy the JSON or download it as a .json file.
How YAML is read
The converter follows YAML 1.2, the current version of the standard, which is also what JSON tools expect:
YAML values in JSON
| YAML | JSON |
|---|---|
port: 8080 | "port": 8080 |
debug: false | "debug": false |
country: NO, answer: yes | The text "NO" and "yes" — in YAML 1.2 only true and false are booleans |
version: "3.9" | "3.9" — quoted values stay text |
date: 2026-11-20 | "2026-11-20" — JSON has no date type |
empty: or ~ | null |
- Anchors and aliases (
&envand*env) are expanded, so the JSON contains the full value at each place. Merge keys (<<: *defaults) are applied too. - Several documents separated by
---become a JSON list with one entry per document — common in Kubernetes files. - Comments are dropped, because JSON has no comments.
- Tabs are not allowed for indentation in YAML. If you get an error about indentation, replace tabs with spaces.
- Protection against "YAML bombs": a file whose aliases would expand to millions of values is stopped with a message instead of freezing your browser.
To tidy or check the result, use the JSON formatter.
Frequently Asked Questions
Is my YAML uploaded?
No. It is parsed in your browser, so configuration files with hostnames or keys never leave your device. Still, avoid pasting real secrets into any website.
Why is "yes" not converted to true?
This converter uses YAML 1.2, where only true and false are booleans. Older YAML 1.1 tools also treated yes, no, on and off as booleans, which caused surprises such as the country code NO becoming false.
What happens to multiple documents?
A file with several documents separated by --- becomes a JSON list, with one entry for each document.
Why do I get an indentation error?
YAML uses indentation with spaces to show structure. A tab, or a line indented by a different number of spaces than its neighbours, makes the file invalid. The message shows the line to fix.