YAML to JSON
Convert YAML to JSON — including anchors, merge keys and multi-document files.
Processed locally in your browser. Nothing you enter is uploaded or stored.
- Reports YAML syntax errors with a location instead of failing silently.
- Resolves the `<<: *anchor` merge-key idiom into a genuinely merged object, not a literal `<<` key.
- Handles `---`-separated multi-document YAML (standard in Kubernetes manifests) by combining documents into a JSON array instead of failing.
- Outputs formatted JSON you can pass straight to code or an API.
- Runs in your browser; config isn't uploaded.
Why this is private
- Processed locally in your browser. Nothing you enter is uploaded or stored.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Converts YAML to JSON — useful when you need to consume a YAML config file from code that expects JSON. Resolves anchors, aliases and merge keys (`<<: *anchor`), and handles multi-document files (`---`-separated), both common in Docker Compose, CI and Kubernetes YAML.
How to use it
- 1Paste YAML.
- 2The JSON output updates automatically.
Frequently asked questions
What people use it for
Consume a YAML config from JSON-only codeConvert a `.yml` file into JSON your app can `JSON.parse`.
Convert a Docker Compose file that uses merge keys`<<: *defaults` blocks are resolved into the actual merged fields, not left as a literal key.
Convert a multi-document Kubernetes manifestA file with several `---`-separated resources becomes one JSON array.
Diff two YAML files reliablyConvert both to JSON so indentation and anchor style don't muddy the diff.
Related guides
- How to read JSON with a tree viewerA tree viewer turns a wall of brackets into a structure you can expand, search and copy paths from. Here's how to use one effectively.
- JSON parse errors explained: 'Unexpected token', 'Expected comma or brace', and the restWhat each common JSON error message actually means, the usual cause, and how to find the spot fast using line and column.
- How to format JSON (and actually understand the errors)JSON looks like a JavaScript object but follows stricter rules. Here's what those rules are and how to read the errors when they're broken.
Related tools
All developer toolsReady to use YAML to JSON?
YAML to JSON