Features
- Readable outputTwo-space indentation without forced line wrapping.
- Strings stay stringsValues such as "true" or "1" are quoted so they keep their type.
- Runs on your deviceYour data is processed in the browser and is never uploaded.
How to use the JSON to YAML converter
- Paste JSON.
- Check the YAML on the right.
- Copy or download it.
JSON and YAML
YAML 1.2 is designed so that JSON documents are also valid YAML. Block style is simply easier to read and allows comments.
Convert JSON to YAML in JavaScript
import yaml from 'js-yaml';
const output = yaml.dump(JSON.parse(input));
Frequently asked questions
Are comments added?
No. JSON has no comments to carry over.
Is key order kept?
Yes.
Which library is used?
js-yaml, an open source MIT-licensed library, run locally.