How to convert YAML to JSON
- Paste the YAML or open a .yaml or .yml file.
- Keep Language on YAML and Action on To JSON.
- Fix any error at the line and column shown.
- Copy the JSON or download converted.json.
Worked example
The YAML service: with port: 8080 and hosts: [a.example, b.example] indented under it becomes {"service":{"port":8080,"hosts":["a.example","b.example"]}}, and answer: yes stays the text "yes".
Formats and limits
| Input | YAML |
|---|---|
| Output | JSON |
| Engine | js-yaml (YAML 1.2) and fast-xml-parser with validator |
Limitations
- .inf and .nan have no JSON equivalent and become null, with a warning.
- Comments are dropped.
- Files up to 50 MB.
Questions
Is yes turned into true?
No. YAML 1.2 rules are used, so yes, no, on and off stay text; only true and false become booleans.
What happens to comments and anchors?
JSON has no comments, so they are dropped. Anchors, aliases and << merge keys are resolved into plain values.
Is my YAML uploaded?
No. It is parsed and converted in your browser.
Privacy
Runs on your device. Files and text are processed in this browser tab and are not uploaded.
This page opens the YAML and XML formatter and validator ready for this task. See the privacy policy for how toolsdocks handles data.