JSON to YAML Converter
Convert JSON to readable YAML, with quotes added only where a value would otherwise change meaning: yes, 1.0, 12:30 and dates included.
name: my-plugin
version: "1.0"
active: true
tags:
- wordpress
- yaml
deploy:
branch: main
at: "12:30"
Output is valid and updates as you type.
Fix the highlighted fields to update the output.
Paste JSON, get YAML that reads back as the same data. The quoting is the part that matters, and it is done for you.
How to use
- Paste the JSON. Invalid JSON is reported with a line and column before anything is converted.
- Pick the indent. Two spaces is the convention; YAML forbids tabs for indentation, so they are not offered.
- Leave multiline strings as blocks unless you need a single line. A literal block shows the text as text instead of escaping the newlines.
- Add the document marker if the file will hold more than one document, or if your tool insists on it.
- Copy the YAML. Every value that would change meaning unquoted has been quoted, and nothing else has.
Example
{
"name": "my-plugin",
"version": "1.0",
"active": true,
"tags": ["wordpress", "yaml"],
"deploy": { "branch": "main", "at": "12:30" }
}
becomes
name: my-plugin
version: "1.0"
active: true
tags:
- wordpress
- yaml
deploy:
branch: main
at: "12:30"
version and at are quoted and name is not. Bare 1.0 is a number, and bare 12:30 is 750 to a YAML 1.1 reader, which is the sort of thing that only shows up in production.
Pitfalls
yes,no,on,off,yandnare booleans to a YAML 1.1 reader, and most readers still are. A country code ofNOunquoted becomesfalse.- A date-looking string becomes a date object in many parsers, so
2026-09-26is quoted here to keep it a string. - Times are base 60.
12:30reads as 750 unless quoted, and1:2:3as 3723. - Leading zeros disappear when a value is read as a number, which is why
007is quoted. - Tabs are not valid YAML indentation anywhere. If you reindent the output by hand, use spaces.
- A key can need quoting too. A key of
yesis booleantrue, and a key containing a colon is ambiguous to most readers. - YAML is a superset of JSON, so the reverse direction needs no conversion at all: a YAML parser reads JSON as it stands.
- Anchors, aliases and comments have no JSON equivalent, so nothing here emits them. Add them by hand afterwards if you want them.
Compatibility
The output targets YAML 1.2 and stays readable by YAML 1.1 parsers, which is what the extra quoting is for. Block scalars, flow collections for empty containers and double-quoted escapes are all core YAML, supported by PyYAML, js-yaml, Symfony YAML and Go’s gopkg.in/yaml. The tool itself runs in any browser from 2017 onwards, with no upload.
Frequently asked questions
Why are some strings quoted and others not?
Can I convert YAML to JSON here?
Is the key order kept?
What happens to an empty object or array?
{} or [], which is valid YAML and unambiguous.