YAML ↔ JSON Converter

Paste YAML or JSON and get the other format instantly — with real parse errors, line numbers, and your choice of indentation.

Why convert between YAML and JSON?

YAML and JSON describe the same data model — maps, lists, strings, numbers, booleans — just with different syntax. YAML dominates configuration: Kubernetes manifests, GitHub Actions workflows, docker-compose files, Ansible playbooks. JSON dominates everything programmatic: HTTP APIs, jq pipelines, JavaScript, database documents. So the round trip comes up constantly — you want to feed a Kubernetes manifest to an API that only accepts JSON, or turn an API response into a readable config file. Because every valid JSON document is also valid YAML, JSON → YAML always succeeds; the reverse only fails when the YAML itself is malformed, and this tool shows you exactly where, with the line and column from the parser.

The YAML gotchas this converter makes visible

YAML's readability comes at the price of surprising implicit typing. The classic "Norway problem": in older YAML versions the bare values no, yes, on and off parse as booleans, so a country code column turns NO into false. Unquoted 3.10 becomes the number 3.1 — a famous source of broken Python-version matrices in CI. Converting your YAML to JSON is the fastest way to see what the parser actually understood: every value's real type is explicit in the JSON output. If something looks wrong, quote the value in your YAML and convert again.

FAQ

Is every JSON file valid YAML?

Yes — YAML 1.2 is a strict superset of JSON, so any JSON document can be parsed by a YAML parser unchanged. The reverse is not true: YAML adds anchors, multi-line strings, comments and unquoted keys that JSON has no syntax for. That's also why comments are lost when you convert YAML to JSON — JSON simply cannot represent them.

What happens to YAML anchors and aliases (&, *)?

They are resolved during parsing: the aliased content is expanded in place, so the JSON output contains the fully dereferenced data. Converting back to YAML will not reconstruct the anchors — you get the expanded form, which is semantically identical.

Does my config leave the browser?

No. Parsing and serialization run entirely client-side with the js-yaml library compiled into this page. Config files often contain credentials and internal hostnames — nothing you paste here is uploaded, logged or stored.

Built by Abasthan Cloud

Free tools are just the start

Deploy your next app on bare-metal cloud with per-second billing — your first app is free, no credit card required.