YAML to JSON Converter — Round-Trip Supported
Convert YAML to JSON, or JSON to YAML. Useful for Kubernetes manifests, Docker Compose files, GitHub Actions workflows and CI/CD configs.
Why YAML and JSON?
YAML and JSON encode the same kinds of data structures — objects, arrays, strings, numbers, booleans, null — but in very different syntaxes. YAML is human-readable and human-writable (indentation-based, comments allowed); JSON is strict, machine-friendly, and universally consumed by code. Modern infrastructure is full of both: Kubernetes uses YAML for manifests, GitHub Actions and GitLab CI use YAML for pipelines, Docker Compose uses YAML for service definitions, but most APIs and JavaScript code expect JSON.
This tool converts cleanly in both directions using js-yaml, the industry-standard JavaScript YAML parser.
Common scenarios
- Kubernetes manifest conversion — paste YAML, get JSON for a JS tool, or vice versa.
- Docker Compose to JSON for tooling that doesn't speak YAML.
- GitHub Actions workflow inspection — convert YAML pipeline to JSON for analysis.
- Configuration file conversion between projects that use different formats.
- API response normalisation — convert YAML responses (rare but seen) to JSON for processing.
- Reading minified JSON by converting to YAML — YAML's indented form is sometimes more readable than JSON.
YAML gotchas
- Tabs not allowed for indentation in YAML — only spaces. If your file uses tabs, the parser will error.
- Norway problem —
no,NO,off,nare interpreted as boolean false in YAML 1.1. Wrap country codes in quotes. - Trailing whitespace on keys can cause subtle bugs.
- Mixed indentation levels within the same block fail to parse.
Tips
- Always quote string values that look like booleans or numbers in YAML:
"true"nottrueif you actually want the string. - For configuration files, prefer YAML for human-edited content, JSON for machine-generated content.
- YAML supports multiline strings (
|and>) which JSON doesn't — those become single-line strings with escaped newlines after conversion. - YAML comments are dropped in JSON conversion. Re-add them after conversion if needed.
FAQs
Is anything uploaded?
No. Runs in your browser via js-yaml.
Does it support multi-document YAML (---)?
Only the first document is converted. For multi-document YAML, split first.
Are YAML anchors and references resolved?
Yes — js-yaml resolves &anchor and *anchor references during parsing.