YAML to JSON Converter (and JSON to YAML)
Convert configuration files between YAML and JSON in either direction, with validation that points to the exact line of any error. Great for Kubernetes manifests, Docker Compose, CI workflows and API payloads.
How to convert YAML and JSON
- Choose the direction: YAML to JSON or JSON to YAML.
- Paste your document on the left. The converted output appears on the right as you type.
- If there is an error, the message shows the line and column so you can fix it.
YAML and JSON compared
JSON is strict and unambiguous, which makes it ideal for APIs and machine-to-machine data. YAML is a superset of JSON designed for humans: indentation instead of braces, comments, and less punctuation, which is why Kubernetes, Docker Compose, Ansible and most CI systems use it for configuration.
YAML's flexibility has traps. Indentation must use spaces, not tabs. Unquoted values are interpreted by type, so port: 08080, version: 1.10 (becomes 1.1) and dates may not be what you expect; quote them to keep them as strings. This converter follows the YAML 1.2 core schema, so yes and no stay strings rather than becoming booleans.
Converting to JSON is also a quick way to check exactly how a YAML file will be parsed. Comments are dropped when converting to JSON, since JSON has no comment syntax. Conversion uses the open-source js-yaml library and runs entirely in your browser, so configs with secrets never leave your machine.
Need a different tool? Suggest it here — we read every message.
Frequently asked questions
Is YAML a superset of JSON?
Yes, YAML 1.2 is designed so that valid JSON is also valid YAML.
Why are my comments missing in the JSON?
JSON does not support comments, so they cannot be carried over.
Can it handle multiple YAML documents?
Yes. Files with --- separators are converted to a JSON array of documents.
Is my data uploaded?
No. Everything is converted locally in your browser.