JSON ↔ YAML Converter
Convert between JSON and YAML in either direction with one click.
Quick answer: JSON ↔ YAML Converter: convert between JSON and YAML in either direction with one click. Runs entirely in your browser, free, no signup.
Last updated
Good to know
YAML is essentially a superset of JSON, so JSON → YAML always succeeds and is the direction most people want — turning a terse API payload into the readable, comment-friendly form that Kubernetes manifests, GitHub Actions workflows, and Docker Compose files use. The reverse, YAML → JSON, works for any YAML whose features JSON can represent.
Two YAML features have no JSON equivalent, so expect them to change. Comments are dropped entirely, because JSON has no comment syntax — keep a commented source of truth if the annotations matter. Anchors and aliases (&name / *name), which let YAML reference a block in multiple places, are expanded inline on conversion; the result is logically identical but has the shared block duplicated wherever it was referenced.
Number precision is a shared trap: both formats store numbers as IEEE-754 doubles, so integers above 2^53 (about 9 quadrillion) — think Twitter/Snowflake IDs — silently lose precision. If your data has huge integers, keep them as quoted strings in the source so they survive the round trip untouched.
Don't be alarmed if the YAML output looks reorganized: the emitter normalizes quoting and block style, adding quotes only where the spec requires them. The structure is unchanged even when the bytes differ. To simply tidy an existing YAML file without converting it, use the YAML formatter.
Frequently asked questions
- Will my comments survive YAML → JSON?
- No — JSON has no comment syntax. Comments are silently dropped.
- What about anchors and aliases?
- We expand them on conversion to JSON, since JSON can't express references. The result has a little duplication but the same logical structure.
- How does the converter handle big numbers?
- Both formats use IEEE-754 doubles, so values above 2^53 lose precision. If you need exact large integers, keep them as strings in your source data.
- Are my files uploaded?
- No — both directions run entirely in your browser.
- Why is my YAML output sometimes very different from the input?
- We normalise — quoting strings only where required, choosing the canonical block style, alphabetising in some cases. The structure is identical even if the bytes aren't.