The same data in both formats
# YAML
server:
host: localhost
ports:
- 80
- 443
{"server":{"host":"localhost","ports":[80,443]}}
YAML uses indentation where JSON uses braces and brackets. This converter parses input with js-yaml, a widely used library that follows YAML 1.2, so nested maps, lists of objects, block text and flow syntax such as [1, 2] all work. Parsing happens in your browser.
What has no JSON equivalent
- Comments are discarded because JSON cannot hold them, so a round trip through JSON loses them for good.
- Anchors and aliases are expanded into full copies of the data.
- A date like 2026-11-11 is read as a timestamp and comes out as a full ISO string. Put it in quotes to keep it as written.
- A file with several documents separated by --- is rejected, because JSON has a single root. Convert one document at a time.
The Norway problem
YAML 1.1 read unquoted yes, no, on and off as booleans. A list of country codes containing NO would quietly turn Norway into false. YAML 1.2 limits booleans to true and false, and this converter follows it, so no stays a string here. Other software may not: PyYAML and parts of the older Ruby and Go ecosystems still apply 1.1 rules. Quote any value that could be misread.
Numbers have similar traps. A version like 1.10 parses as the number 1.1, and a ZIP code like 01234 can lose its leading zero, so put quotes around anything that is really an identifier.
Fixing the most common errors
Parse errors report the line and column. Indentation must use spaces, because tabs are forbidden for it. Items at the same level must line up exactly. A colon needs a space after it to separate a key from a value, so a:b is one string. A value containing ": " or starting with a character like *, & or { needs quotes.
Duplicate keys are treated as an error, which helps, because some parsers silently keep the last one and hide the mistake.