YAML to JSON Converter & JSON to YAML Online
Paste YAML from docker-compose, Kubernetes or GitHub Actions and get JSON instantly, with anchors expanded and multi-document files (---) as an array.
Updated November 2026
Reviewed by Rafael Duarte
How to use the YAML to JSON converter
Pick a direction, paste, get validated output instantly
1. Pick a direction
Toggle "YAML → JSON" or "JSON → YAML" at the top of the tool.
2. Paste your input
Drop it in the left panel, or click "Paste" to grab it straight from your clipboard.
3. Copy or download the result
The output updates as you type. A "Valid YAML" or "Valid JSON" badge confirms the input parsed; then click Copy, or Download to save it as output.json or output.yaml.
What this YAML to JSON converter does
Accurate conversion in both directions
Real-time validation
A green "Valid YAML" or "Valid JSON" badge confirms your input parsed. If it doesn't, you get "Invalid" and the parser's message with the line and column.
Resolves anchors, aliases and merge keys
YAML's & anchors, * aliases and <<: *base merge keys (common in docker-compose x- blocks) are fully expanded in the resulting JSON.
Multi-document files
Several documents separated by ---, like a Kubernetes manifest or helm template output, become one JSON array with one item per document.
Lossless JSON to YAML
Since YAML 1.2 is a superset of JSON, this direction always converts cleanly, preserving every type and nesting level.
Runs entirely in your browser
No sensitive config — API keys, secrets, connection strings — ever leaves your device.
Examples
What changes and what doesn't
# comment in the YAML&ref anchor and *ref aliasa: 1 --- b: 2[{"a": 1}, {"b": 2}]python-version: 3.103.1 (a number; quote it as "3.10" to keep the string)on: push"on": "push" (YAML 1.2: on, yes and no stay strings)When you'll reach for this tool
The scenarios that come up most often
Kubernetes and Helm
Feed YAML manifests into CI/CD pipelines that only accept JSON, or convert Helm values back for readability.
OpenAPI and Swagger specs
Convert a YAML API spec to JSON when your toolchain requires it, or flip it back for human review.
Docker Compose and Ansible
Move service configs or playbooks between formats depending on which tool downstream is consuming them. New to Compose? Read Docker Compose for development.
GitHub Actions workflows
Debug or adapt YAML workflow files by converting them to JSON for schema validation.
Common mistakes
Expecting comments to survive the conversion
JSON has no comment syntax — keep the original YAML alongside the generated JSON if you need the documentation.
Unquoted values change type
YAML guesses types for unquoted scalars, and the JSON shows the result: 3.10 becomes the number 3.1 (the classic GitHub Actions python-version trap), 0777 becomes 777, and 2024-01-15 becomes the string "2024-01-15T00:00:00.000Z". Quote the value in the YAML ("3.10") to keep it exactly as written.
Not realizing aliases get expanded
The resulting JSON contains no YAML-specific constructs — every anchor and alias is fully resolved into its actual value.
Inconsistent indentation in the source YAML
YAML is indentation-sensitive — mixing tabs and spaces is the single most common cause of parsing errors.
Why use this converter
It resolves the parts that trip up simpler converters (anchors, aliases, merge keys, multi-document files) and tells you upfront what gets lost: comments are dropped, and unquoted values like 3.10 or dates change type.
Everything runs client-side in your browser, so it's safe to convert sensitive config files, templates with embedded API keys, and infrastructure definitions without them ever touching a server.
YAML vs. JSON
Same data, different audiences
#)Frequently asked questions
YAML uses indentation and minimal punctuation, which makes it easier for humans to hand-edit — that's why Kubernetes, Docker Compose, and Ansible all use it for config. JSON uses braces and brackets with stricter syntax, and it's the standard for REST APIs and data interchange. Because YAML 1.2 is a superset of JSON, any JSON document is already valid YAML.
Yes. JSON has no comment syntax, so any line starting with # in your YAML is dropped during conversion. If you need to keep the documentation, hold on to the original YAML file alongside the generated JSON.
They're fully resolved: the value an alias points to gets expanded inline at every place it's referenced. The resulting JSON has no YAML-specific constructs left — just plain values and structures.
Yes. Because YAML 1.2 is a superset of JSON, this direction preserves every type, nested structure, and value. The one exception is integers above 2^53 (9,007,199,254,740,991), which the browser's JSON.parse already rounds when reading the input.
Yes. The entire conversion runs in your browser via JavaScript — nothing is uploaded to a server, stored, or logged anywhere.
Yes. Kubernetes manifests, Helm values, Docker Compose files and Ansible playbooks work without any special setup: paste the YAML and the converter parses standard YAML 1.2. If the file holds several documents separated by ---, the JSON output is an array with one item per document.
Paste it in the YAML → JSON direction. If it parses, you see a "Valid YAML" badge and the JSON. If not, the badge says "Invalid" and the parser's message points to the line and column, for example missed comma between flow collection entries (2:1). This checks syntax only, not a schema like Kubernetes' or GitHub Actions'.
The converter follows YAML 1.2, where only true and false are booleans. on, yes, no, off stay plain strings, so on: push becomes "on": "push". Older YAML 1.1 parsers turn on into true, which is why you may see different output elsewhere.
References
Related Tools
- CSV to JSON Converter & JSON to CSV Online Developer Paste or upload a CSV (comma, semicolon, tab or pipe) and get clean JSON. Also converts JSON to CSV that Excel opens without garbled characters.
- JSON Formatter & Validator: Fix Errors, Tree View Developer Format, validate and minify JSON with errors shown by line and column, one-click fixes for trailing commas and quotes, and tree or graph views.
- JSON to TypeScript: Generate Interfaces or Types Online Developer Paste JSON and get TypeScript interfaces or types, with nested objects and optional fields inferred from every array item. Also repairs broken JSON.
- Base64 Decode Online — Free Base64 to Text Decoder Developer Free online Base64 decoder — decode Base64 strings back to plain text instantly in your browser. Validates input and shows decoded payload size.
- Base64 Encoder: Encode Text, PDF & Files Online Developer Encode UTF-8 text or any file (PDF, DOCX, XLSX, ZIP up to 50 MB) to Base64 or Base64URL. Runs in your browser, nothing is uploaded. Free, no sign-up.