YAML
YAML Converter
Convert between YAML and JSON in both directions.
About YAML and JSON
YAML and JSON describe the same shapes — maps, lists, strings, numbers, booleans — with different punctuation. YAML leans on indentation and is written by hand; JSON is explicit and is what most APIs and libraries actually consume. Converting between them is mostly mechanical, with the caveat that YAML has features, such as comments and anchors, that JSON simply has no way to express.
YAML's type rules are narrower than they look. Only true/false (and case variants like True or TRUE) parse as booleans — yes, no, on, and off are left as plain strings, unlike some older YAML parsers that treated them as booleans too, a discrepancy known online as the "Norway problem" because the country code NO could silently become false. A more common surprise here is precision: JSON numbers are IEEE-754 doubles, so a 64-bit integer past 2^53 can lose a digit or two the moment it's converted, even though the original YAML value was exact.
Where you'll run into it
- Turning a Kubernetes manifest or docker-compose file into JSON for a script
- Pasting an API response into a config file that expects YAML
- Checking that a CI pipeline definition parses the way you expect
- Comparing two config formats while migrating between tools
Frequently asked
What happens to my comments?
They are lost. JSON has no comment syntax, so converting YAML to JSON drops every # line permanently. Keep the YAML original if the comments matter.
Are anchors and aliases supported?
Yes, and they are expanded into the values they point at, because JSON cannot represent a reference. Aliases that refer to other aliases multiply in size very quickly, so conversions that would expand to an enormous document are refused rather than attempted.
Is my data stored?
No. Conversion happens on the server for that one request only; nothing is logged or kept afterward.
Why did my large integer change slightly after converting to JSON?
JSON represents all numbers as IEEE-754 doubles — the same numeric type JavaScript uses — which can only hold integers exactly up to 2^53 (9,007,199,254,740,991). A YAML value like a 64-bit database ID or a Discord-style snowflake can exceed that, and converting it to a JSON number silently rounds it. If exact precision matters, keep such values quoted as YAML strings before converting, so they pass through as JSON strings instead of numbers.