JSON ↔ YAML Converter
Convert JSON to YAML or YAML to JSON for Kubernetes, Docker Compose and CI config files. Clean, readable output generated right in your browser.
YAML input
Stays in your browserJSON output
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to JSON Parser, JSON Beautifier or JSON ↔ TOML Converter.
Free Online JSON ↔ YAML Converter
Convert YAML to JSON or JSON to YAML instantly, with clear error messages if the input isn't valid — no configuration needed either direction. It helps developers move configuration between YAML-based deployment files and JSON-based APIs or tooling.
JSON vs. YAML
JSON and YAML both represent the same kinds of structured data — objects/mappings, arrays/sequences, strings, numbers, booleans, and null — but with very different syntax. JSON uses braces, brackets, and quotes and is easy for machines to parse unambiguously. YAML uses indentation and minimal punctuation, making it more readable by hand, which is why it's the format of choice for configuration files (Kubernetes manifests, GitHub Actions workflows, Docker Compose files) even though APIs overwhelmingly use JSON.
How to convert between them
Choose a direction, paste your YAML or JSON into the input box, and click Convert. If the input isn't valid, the exact parsing error is shown instead of a blank or garbled result. Use Swap with output to immediately convert the result back, useful for verifying a round-trip conversion.
Common use cases
- Converting a Kubernetes or Docker Compose YAML file into JSON for use with a tool that only accepts JSON
- Turning an API's JSON response into more readable YAML for documentation or a config template
- Debugging a YAML config file by round-tripping it through JSON to spot subtle indentation or type issues
Worked example
name: example
items:
- one
- two converts to { "name": "example", "items": ["one", "two"] }. A plain alias like base: &b
name: shared
ref: *b resolves ref to { "name": "shared" }, and a merge key, first:
<<: *b
extra: 1, is expanded to { "name": "shared", "extra": 1 }.
Common mistakes and edge cases
- YAML merge keys (
<<: *anchor) are expanded into the surrounding mapping. A key you write yourself next to the merge key overrides the same key from the anchor. - Converting JSON to YAML never introduces anchors or aliases, even for two branches with identical content — JSON has no concept of shared references, so there's nothing for the converter to detect and deduplicate.