Convert YAML to JSON to read it from code, validate it against a schema, or simply see its structure without depending on indentation.
It accepts files with several documents separated by “---”: in that case the result is a list with one entry per document.
How to use it
- Paste the YAML or open the file.
- Choose the output indentation.
- Copy or download the JSON.
Frequently asked questions
- Why does it say the YAML is invalid?
- Almost always indentation: a tab among the spaces, or a level that does not line up. The error message gives the line where the reader lost its footing.
- Is information lost in the conversion?
- Yes, whatever JSON cannot represent: comments, anchors and references, and the distinction between string styles. All the values survive.
- What about dates?
- YAML recognises them as a type of their own; going to JSON they become text strings in ISO format.
Related tools
JSON to CSVAn array of objects into a table, flattening nested objects.
CSV to JSONDetects the separator, respects quotes and types the values.
JSON to YAMLA straight conversion that keeps the key order.
Format and validate JSONIndent, minify or sort keys, and get the error’s line and column.
Decode a JWTHeader, payload and expiry. The signature is not verified.