Developer Tools
YAML to JSON Converter
Convert configuration between YAML and JSON in either direction.
YAML input
0 charsJSON result
no outputConverted output appears here.
About YAML ↔ JSON Converter
Kubernetes manifests, CI pipelines, Prometheus rules and application config are usually written in YAML, while APIs and JavaScript tooling speak JSON. Moving between the two formats is a routine part of working with configuration, and doing it by hand is a reliable way to introduce indentation bugs.
This converter parses YAML with a full YAML 1.2 loader and emits JSON, or parses JSON and emits standard YAML. Anchors, aliases, multi-line strings and nested collections are all handled, and parse failures are reported with the offending line.
How it works
- Pick a direction: YAML to JSON, or JSON to YAML.
- YAML input is loaded with a YAML 1.2 compatible parser, so anchors and aliases are expanded.
- JSON input is validated first, then serialised into block-style YAML.
- Duplicate keys and tab-indentation errors are reported instead of silently ignored.
- Both panes stay editable so you can round-trip the document and compare the result.
Input and output
Accepts
YAML or JSON text, such as a Kubernetes manifest or an API payload.
Produces
The equivalent document in the other format, ready to copy.
Privacy
Conversion is performed locally by the YAML parser bundled with this page. No network request is made.
YAML ↔ JSON Converter FAQ
Is YAML a superset of JSON?
YAML 1.2 is designed so that valid JSON is also valid YAML, which is why JSON can often be pasted directly into a YAML file. The reverse is not true: YAML has scalars, anchors and multi-line strings that JSON cannot express.
Why do my YAML keys keep changing type in JSON?
YAML resolves unquoted scalars by pattern, so yes can become a boolean and 1.10 can become a number. Quote such values in YAML if you need them preserved as strings.
Are comments preserved?
No. Neither JSON nor the output of this converter carries YAML comments, because comments are not part of the parsed data model.
Can I convert a large Kubernetes manifest?
Yes. Multi-document files separated by --- are supported; each document is converted in order.
Related developer tools
JSON Formatter
Pretty-print, minify and validate JSON with exact error positions.
XML Formatter
Pretty-print, minify and validate XML documents.
Kubernetes YAML Generator
Generate Kubernetes manifests with matching selectors and labels.