YAML to JSON Converter
Convert YAML data to JSON. Instantly turn structures written in YAML — Kubernetes manifests, docker-compose.yml, CI config files — into a format that JSON-only tools like jq can work with, right in your browser.
Usage tips
- Paste a Kubernetes manifest or docker-compose.yml directly to visualize its structure as JSON, so command-line tools like jq that only understand JSON can query it.
- Unquoted values like postal codes or phone numbers that start with a leading zero get parsed as numbers, dropping the leading zero — always quote values you want kept as strings.
- Complex YAML using anchors (`&`), aliases (`*`), or block scalars (`|`/`>`) is not supported. Rewrite it in a simpler form before pasting it in.
- Uncheck "Pretty-print" to get a single-line JSON output with no line breaks — handy when pasting into an API request body where newlines aren't wanted.
Frequently asked questions
Side Note — Why config files are written in YAML but tools want JSON
YAML is widely used for configuration files that humans edit directly — Kubernetes, docker-compose, GitHub Actions workflows, Ansible playbooks — thanks to its readability: comments are allowed and quoting is mostly optional. JSON, by contrast, has a small and unambiguous specification that's easy for programs to process mechanically, which is why it has become the standard input format for API data exchange and command-line tools like jq.
YAML-to-JSON conversion bridges this gap between "humans write YAML, tools want JSON." Kubernetes manifests in particular can run hundreds of lines, and `grep` alone quickly hits its limits when hunting for a specific value. Convert to JSON first, then query it with jq, and you can pull out exactly the value you need with a path like `.spec.containers[].image`.
That said, the full YAML specification (YAML 1.2) is vast, covering advanced features like value reuse via anchors and aliases, multi-document streams, and block scalars for multi-line strings. This tool deliberately skips that entire surface and focuses on the "common subset" of mappings, sequences, and basic scalars that shows up in practice — keeping the implementation simple with zero external dependencies.