YAML ↔ JSON Converter
Convert YAML to JSON or JSON to YAML in your browser. Type or paste either format and the other side updates as you go.
YAML to JSON and back
YAML is a human-friendly configuration format used by Kubernetes manifests, GitHub Actions workflows, Docker Compose files, Ansible playbooks, and many static site generators. JSON is the language of HTTP APIs, configuration parsers, and most tooling. Switching between the two is a routine debugging task.
This converter parses YAML 1.2 using the js-yaml library and serializes the parsed object back as JSON or YAML. The library is bundled with the page, so the input never leaves your browser.
What you can paste
YAML side: block-style maps and sequences, flow style, multi-line strings, numbers, booleans, nulls, and explicit string keys. Anchors and aliases are resolved during conversion.
JSON side: any valid JSON value. Objects and arrays are the common case, but a top-level string, number, boolean, or null also converts cleanly.
Common conversions
Kubernetes manifest: drop a Deployment or ConfigMap on the YAML side to inspect it as JSON, which is useful when writing tests or generating policies.
GitHub Actions workflow: paste a workflow file to see its parsed structure as JSON when diagnosing matrix or step issues.
API response: paste a JSON payload on the right to see a more readable YAML version for sharing in docs or tickets.
Tips and limitations
- YAML 1.2 is largely a superset of JSON, so most JSON pastes cleanly into the YAML side.
- Indentation matters in YAML. Mixed tabs and spaces produce a parse error.
- Comments in YAML are stripped during conversion. JSON has no comment syntax.
- Very large documents may take a moment to parse and serialize on slower devices.
- Multi-document YAML streams separated by
---are not supported. Split the stream into one document before converting.
FAQ
How do I convert YAML to JSON?
Paste YAML on the left and the JSON output appears on the right. The converter parses the YAML, validates it, and serializes the resulting object as JSON with two-space indentation.
How do I convert JSON to YAML?
Paste JSON on the right and the YAML output appears on the left. Block style YAML is produced by default. You can choose the indent width before converting.
Is YAML a superset of JSON?
YAML 1.2 is largely a superset of JSON, so most valid JSON parses cleanly as YAML. The reverse is not always true because YAML supports types and structures that JSON does not, such as anchors, multi-line strings, and explicit tags.
Does the converter upload my data?
No. Parsing and conversion happen in your browser using the js-yaml library bundled with the page. The input never leaves the device.