YAML to JSON Converter
Paste YAML to get formatted JSON, or switch direction to turn JSON into clean YAML. Errors point to the line that broke parsing.
About this tool
YAML is the configuration language of Kubernetes, Docker Compose, GitHub Actions and countless tools, while JSON is what APIs and most programming languages speak natively. The two describe the same data model, so converting between them is lossless for ordinary documents: maps, lists, strings, numbers, booleans and nulls.
This converter uses the yaml library, which implements YAML 1.2 including anchors and aliases, multi-line strings and multiple documents separated by ---. A file with several documents becomes a JSON array. In the other direction, JSON is emitted as block-style YAML with the indentation you choose, and long strings are not wrapped.
Frequently asked questions
- Are comments preserved?
- No. JSON has no comments, so they are dropped when converting to JSON and cannot be recreated on the way back.
- What about multiple YAML documents?
- They are converted together into a JSON array with one element per document.
- Why does my YAML fail to parse?
- Usually indentation: YAML needs consistent spaces, never tabs. The error message names the line and column.
- Is my data uploaded?
- No. Conversion runs entirely in your browser.