How to use YAML to JSON
- Paste your YAML into the input box, or click Open a file to load a .yaml or .yml file.
- Choose 2 spaces, 4 spaces or a tab for the JSON indentation.
- Read the JSON in the output box; YAML errors show the line and column.
- Click Copy or Download to save data.json.
Features
- Parses YAML 1.2 and writes formatted JSON
- Error messages with line and column
- Several documents separated by --- become a JSON array
- Anchors and aliases are resolved
- Runs in your browser, so the YAML is never uploaded
Supported formats and limits
- Maximum input: 10,000,000 characters
Examples
| Input | Result |
|---|---|
| name: OneVixa tools: - json - yaml settings: free: true limit: null | { "name": "OneVixa", "tools": [ "json", "yaml" ], "settings": { "free": true, "limit": null } } |
| --- a: 1 --- b: 2 | [ { "a": 1 }, { "b": 2 } ] — Two documents become a JSON array. |
Limitations
- YAML comments are dropped because JSON has no comments.
- YAML values that JSON cannot represent, such as .inf or .nan, become null.
- Custom YAML tags are not interpreted as special types.
Learn more
YAML is a superset of JSON in version 1.2 of its specification, so every JSON document can be read as YAML, but YAML adds features JSON does not have: comments, anchors and aliases for reusing values, multi-line strings and several documents in one file.
Converting YAML to JSON is useful when a tool or API accepts only JSON, or when you want to see exactly how a configuration file will be interpreted. Unquoted scalars are typed by the parser: 8080 is a number, true is a boolean and null is null, while "8080" in quotes stays text. Seeing the JSON makes these typing surprises visible.
Indentation is structural in YAML. A line that is indented by one space too many or too few changes the meaning or breaks the file, so the reported line and column are the first place to look when a document will not parse.
Frequently asked questions
Why does my YAML give an error?
The usual causes are inconsistent indentation, tabs used for indentation, a missing space after a colon, or an unclosed bracket or quote. The message tells you the line and column.
What happens to comments?
They are dropped, because JSON cannot hold comments.
Can I convert a file with several YAML documents?
Yes. Documents separated by --- are returned together as a JSON array.
Is my YAML uploaded?
No. The conversion runs in your browser.
Sources
- YAML Ain’t Markup Language (YAML) version 1.2.2
- RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format
Last reviewed: September 30, 2026