YAML ⇄ JSON converter
Paste YAML or JSON, choose the direction, then copy the result. Anchors are expanded, comments are dropped and some values may be read differently, so check the output before you use it.
YAML ⇄ JSON converter runs entirely in your browser: the text you paste is never sent to a server. It is free and needs no sign-up.
How to use it
- Paste YAML or JSON Paste up to 5 MB of text into the box. Set the direction to YAML to JSON or JSON to YAML, and choose an indent of 2 or 4 spaces.
- Read the result or error Check the result box. An error shows the line and column where the conversion stopped. Several YAML documents separated by three dashes become one JSON array.
- Copy or download Copy the result, or download it as a .json or .yaml file, depending on the direction you chose.
Questions
What is lost when I convert YAML to JSON?
Comments are dropped and cannot be recovered. Anchors and aliases are expanded, so a repeated value is written out in full each time. Dates such as 2020-01-01 stay as text in the JSON, and JSON numbers larger than JavaScript can store exactly may change.
Why does the converter refuse some YAML?
Only plain YAML values are read. Tags that would build functions, classes or other objects are refused. Aliases that expand to more than one million values are also refused, so remove the repeated aliases before you convert.
How are several YAML documents handled?
Documents separated by three dashes are combined into one JSON array, with one item per document. A message reports how many documents were combined.