YAML to JSON
Convert YAML configs — CI pipelines, Kubernetes manifests, OpenAPI specs — into JSON, with precise parse errors.
YAML input
JSON output
Enter YAML on the left to convert it.
What is YAML to JSON?
A YAML to JSON converter parses YAML's indentation-based syntax and re-serializes the same data as JSON. YAML is what configuration lives in — GitHub Actions and GitLab CI pipelines, Kubernetes manifests, Helm values files, Docker Compose stacks, Ansible playbooks, OpenAPI specifications — because it is comfortable to write by hand and supports comments. JSON is what tooling consumes: validators, JSONPath queries, schema checkers, HTTP APIs, and most programming libraries. Converting between them is a routine step when you want to inspect a config with a JSON-oriented tool, feed a spec into something that rejects YAML, or simply see the literal data structure a fragile block of indentation actually produces. Because YAML is a superset of JSON, this direction is lossless for the data itself, though anything that exists purely for human readability — comments, quoting style, line breaks in block scalars — has no JSON equivalent and is not carried across.
How to use YAML to JSON
- Paste your YAML into the left panel, or load a .yaml or .yml file from disk with the folder icon in the side rail.
- The equivalent JSON appears on the right immediately, pretty-printed with two-space indentation.
- If the YAML is malformed, the panel shows the parser's own message describing what it found and where, so you can fix the indentation or syntax and watch the output update as you type.
- Copy the JSON, or use the swap button to reverse the converter and turn JSON back into YAML.
Examples
Nested mapping and a list
Input
name: jsonforge ports: - 80 - 443 meta: active: true
Output
{ "name": "jsonforge", "ports": [ 80, 443 ], "meta": { "active": true } }
Comments are dropped — JSON has no syntax for them
Input
# deployment target replicas: 3
Output
{ "replicas": 3 }
Common mistakes
- Mixing tabs and spaces for indentation — YAML forbids tabs for indentation entirely, and the resulting parse error often points at a line further down than the one actually at fault.
- Expecting merge keys (<<: *defaults) to be flattened into the parent mapping — they arrive as a literal "<<" key instead, so config built on shared defaults needs a manual pass after converting.
- Treating the converted JSON as a replacement for the original YAML file — every comment explaining why a setting exists is gone, which is usually the most valuable thing in a config.
Why use this tool
- Runs entirely client-side, so CI pipelines and Kubernetes manifests with internal details never leave your machine.
- Reports the parser's exact error text and position on malformed YAML instead of failing silently or guessing at your intent.
- Reversible in the same tool — swap the direction to turn the JSON back into YAML without switching pages.