Try
About this tool
- Runs in
- your browser
- Your input sent to our servers
- Nothing
- Kept on this device
- nothing
More in the privacy policy.
How to use it
- 01Paste JSON, open a .json file or drop one on the page, or pick one under Try.
- 02The YAML appears as you type; if the JSON has an error, its line and column are shown. Choose a 2- or 4-space indent.
- 03Copy the YAML or download it as a file, or press Swap to convert it back to JSON.
Related tools
Questions
Why are some values in quotes?
Because a YAML reader would take them for something else: yes is a boolean to YAML 1.1 readers such as Ansible, 01234 looks like a number, 1.10 is the number 1.1. Quoting keeps them strings for readers of either version: {"enabled": "yes", "zip": "01234", "version": "1.10"} gives enabled: "yes"; zip: "01234"; version: "1.10". Ordinary text isn’t quoted.
What happens to arrays?
An array becomes a YAML list, one - per item, and an array of objects a list of mappings, as in a Kubernetes container list: [{"name": "web"}, {"name": "db"}] gives - name: web; - name: db.
Are key order and big numbers kept?
Keys keep the JSON’s order, except keys that are whole numbers, which come first, as in JavaScript: {"b": 1, "2": 2} gives "2": 2; b: 1. Whole numbers of any size are written exactly: {"id": 12345678901234567890} gives id: 12345678901234567890, where many converters round it.
Is my file sent anywhere?
No. It’s converted in your browser as you type, and a file you open is read there too. It isn’t sent to our servers, put into the page address or saved.