JSON ↔ YAML Converter
Convert JSON to YAML and YAML to JSON without losing large numbers, with anchors, merge keys and safe quoting.
Runs locally in your browser. Your input is not uploaded.Free, no sign-up
JSON
YAML
How to use the JSON ↔ YAML converter
- Choose JSON → YAML or YAML → JSON.
- Paste your input, or click Sample for a Kubernetes Deployment (JSON) or a Docker Compose file (YAML).
- The converted result appears instantly. Errors show the line and column.
- Copy or Download the result, or Swap to convert it back.
What makes this converter safe
- No lost digits. Large integers like
12345678901234567890stay exact in both directions, and JSON numbers such as19.90keep their spelling in YAML. - No "Norway problem". Older YAML 1.1 parsers (used by SnakeYAML in Spring Boot, PyYAML and many Kubernetes tools) read
NO,yes,offand~as booleans or null. Strings like these are quoted, so"NO"stays the country code for Norway. - Real-world YAML. Anchors, aliases and
<<merge keys (common in Docker Compose and CI files) are resolved. Multiple documents separated by---become a JSON array. - Safe with untrusted input. Alias bombs ("billion laughs") are detected and stopped.
Frequently asked questions
Is my data uploaded?
No. Conversion happens entirely in your browser. Configuration files and secrets never leave your machine.
What happens to YAML comments?
JSON has no comments, so they're removed when converting YAML to JSON. You'll see a note when that happens.
Why are some strings quoted in the YAML output?
Only where needed: when a string would otherwise be read as a number, boolean or null, or contains characters with a special meaning in YAML, such as : or #.
Is YAML a superset of JSON?
YAML 1.2 is, so any JSON document is valid YAML. The reverse isn't true: YAML adds comments, anchors, multiple documents and more types, which is why YAML → JSON needs a real converter.
Related tools
All tools- JSON FormatterFormat, validate and minify JSON with syntax highlighting and precise error locations.
- JSON ValidatorValidate JSON, see the exact line and column of syntax errors, and fix common mistakes.
- JSON MinifierRemove whitespace from JSON and see the original size, minified size and savings.
- Base64 Encoder / DecoderEncode text to Base64 and decode Base64 to text, with UTF-8 and URL-safe support.
- URL Encoder / DecoderPercent-encode and decode URLs and URL components.