Features
- Error messagesSyntax problems are reported with their position.
- Multiple documentsDocuments separated by --- become a JSON array.
- Runs on your deviceYour data is processed in the browser and is never uploaded.
How to use the YAML to JSON converter
- Paste YAML or open a file.
- Fix any reported error.
- Copy the JSON.
The YAML type trap
Older YAML versions read yes, no, on and off as booleans. This converter follows the core schema, where only true and false are booleans, and dates stay text.
Convert YAML to JSON in JavaScript
import yaml from 'js-yaml';
const json = JSON.stringify(yaml.load(input), null, 2);
Frequently asked questions
Are anchors and aliases supported?
Yes.
Are comments kept?
No. JSON cannot hold comments.
Why does indentation fail?
YAML does not allow tab characters for indentation.