Convert YAML to JSON and JSON to YAML instantly | 100% Private
Convert YAML to JSON or JSON to YAML with a single click, then swap to round-trip.
Nested mappings, lists of objects, flow collections, block scalars, and comments.
Bad indentation or invalid syntax gets a specific message with the line number.
Config files often hold secrets — yours never leave your browser.
YAML and JSON describe exactly the same data model — objects, arrays, strings, numbers, booleans and null. The difference is entirely in the syntax and who it is optimised for. JSON is compact and unambiguous, which makes it ideal for APIs and machine-to-machine exchange. YAML uses indentation instead of braces and allows comments, which makes it far more pleasant to hand-edit — the reason Kubernetes, Docker Compose, GitHub Actions, and Ansible all use it.
YAML is a superset of JSON, so any valid JSON document is already valid YAML. The reverse is not true: YAML features like comments, anchors, and block scalars have no JSON equivalent. Comments in particular are silently dropped when converting to JSON, since JSON has no comment syntax at all.
Tabs are forbidden for indentation — YAML requires spaces, and mixing the two is the single most common parse error. Unquoted values like yes, no, on, and off are interpreted as booleans, which surprises people writing country codes like NO for Norway. Version numbers like 2.0 become the number 2, losing the trailing zero, so quote them if you need the exact string.
Converting YAML to JSON is useful when feeding a config into a tool or API that only accepts JSON, or when you want to validate structure quickly. Converting JSON to YAML is useful when turning an API response into a readable config file, or when you want to add comments explaining each field to your team.
Paste your YAML into the input box with the YAML → JSON mode selected. The equivalent JSON appears instantly in the output box, ready to copy or download.
Both represent the same kinds of data — objects, arrays, strings, numbers, booleans and null. JSON uses braces, brackets and quotes, making it compact and easy for machines to parse. YAML uses indentation and supports comments, making it easier for humans to read and edit, which is why it dominates configuration files.
Yes. Comments starting with # are ignored during parsing, and block scalars using the | and > markers are converted into multi-line strings. Note that JSON has no comment syntax, so comments are dropped in the JSON output.
No. Parsing and conversion run entirely in your browser using JavaScript. Your YAML or JSON is never transmitted, logged, or stored anywhere — which matters because config files often contain hostnames, keys, and other sensitive values.
Anchors and aliases (& and *), multi-document streams, and custom type tags are not supported. The converter reports a clear error for these rather than producing a silently incorrect result.