Paste YAML or JSON below, pick a direction, and click Convert. YAML is parsed with the battle-tested js-yaml library and parse errors include line information. Everything runs in your browser; nothing is uploaded.
YAML and JSON describe the same data model — mappings, sequences, and scalars — with very different syntax. Modern infrastructure lives in YAML (Kubernetes manifests, docker-compose files, GitHub Actions workflows, Helm values), while application code and APIs overwhelmingly speak JSON. Moving between the two is a daily chore: you want to feed a compose file into a script that expects JSON, or inspect an API response as YAML because the braces are hurting your eyes. This converter does both directions in one click, entirely in your browser.
YAML parsing uses js-yaml, the most widely used YAML library in the JavaScript ecosystem, so edge cases behave the way your tooling expects. JSON output is pretty-printed with two-space indentation; YAML output wraps long lines at 100 characters. There is no API call, no upload, and no storage.
&defaults / *defaults references are resolved into full copies of the data.true, null, and numbers become real JSON booleans, nulls, and numbers. This is where surprises hide: an unquoted version like 3.10 parses as the number 3.1. Quote values that must stay strings.Every valid JSON document is representable in YAML, so this direction never loses data. The converter emits block-style YAML — indented mappings and dash-prefixed sequences — which is what humans expect to read. Strings that could be misread as numbers or booleans are automatically quoted by the emitter, so round-tripping is safe.
port:8080 is one scalar string, not a key-value pair. Convert to JSON and the mistake becomes obvious.NO, git SHAs made of digits, or octal-looking IDs — converting to JSON reveals what type each value actually parsed as.If a manifest fails in CI or a cluster rejects it, converting it here is a fast sanity check: a parse error with a line number points at the syntax problem, and clean JSON output confirms the structure is what you intended. For a tour of the usual suspects, see our guide to common YAML errors in Kubernetes and CI.
Use YAML where humans edit files by hand and comments matter: configuration, infrastructure manifests, CI pipelines. Use JSON where machines exchange data: APIs, logs, storage. Both formats express the same structures, so pick per audience — and use this tool at the boundary. For a fuller comparison, read YAML vs JSON: the differences explained.
Working with JSON? Try the JSON Formatter or the JSON Schema Generator. To go deeper, read YAML vs JSON: Differences Explained, Common YAML Errors in Kubernetes and CI, and JSON Parsing Errors: Common Causes and Fixes.