Why convert YAML and JSON?
YAML is common in Kubernetes manifests, CI pipelines, and Ansible-style configs because it is readable for humans. JSON is the lingua franca of REST APIs and browser-native data. Teams often need both: edit YAML by hand, then paste JSON into an API client, or reverse the flow when importing samples into a YAML-first repo.
This page helps you translate between the two shapes quickly, with validation and formatting so you catch structural mistakes before they reach production.
How to use this tool
- Choose YAML → JSON or JSON → YAML with the direction radios.
- Paste or type in the input pane. Valid conversions appear in the output pane on the right.
- Click Validate to confirm the current input parses under this tool’s rules.
- Use Format to pretty-print YAML (via parse and reserialize) or JSON (standard two-space indent).
- Copy output sends the result to your clipboard; Swap direction flips modes without losing your saved inputs per side.
Supported YAML subset
- Mappings with
key: valueand nested blocks using deeper indentation (spaces). - Sequences with
- item, including list items that are nested objects when continuation lines are indented further. - Scalars: quoted strings, plain words, integers and floats, booleans, and null-style tokens where recognized.
- Line comments starting with
#on value fragments are stripped in many scalar positions—avoid putting # inside unquoted values.
Workflow tips
When debugging APIs, paste JSON responses into JSON → YAML mode to read nested payloads with less brace noise. When preparing kubectl or Compose snippets, start in YAML → JSON to feed the same data into tools that only accept JSON bodies.
For heavier JSON work, open the dedicated JSON editor for repair helpers and minify/expand options alongside this converter.