← Back to tools

YAML ↔ JSON Converter

Convert YAML to JSON or JSON to YAML. Live validation.

YAML
JSON

YAML (YAML Ain't Markup Language) and JSON (JavaScript Object Notation) both represent structured data, but serve different purposes. JSON is strict, compact, and ideal for APIs and data exchange between systems. YAML is more human-readable with indentation-based structure, comments, and less punctuation — making it popular for configuration files in Docker, Kubernetes, GitHub Actions, and Ansible.

Converting between the two is common: you might receive a JSON API response but need YAML for a config file, or export YAML settings as JSON for a frontend. This tool handles both directions with full support for nested objects, arrays, strings, numbers, booleans, and null values.

Common pitfalls: YAML is whitespace-sensitive (use spaces, not tabs), and unquoted strings like yes, no, on, off are parsed as booleans. JSON requires double quotes around all string keys and values. This converter validates syntax as you type and shows clear error messages.

This tool in other languages:

Français:
Convertisseur YAML JSON

Español:
Convertidor YAML a JSON

Deutsch:
YAML zu JSON Konverter

Português:
Conversor YAML para JSON

日本語:
YAML JSON 変換ツール

中文:
YAML 转 JSON 转换器

한국어:
YAML JSON 변환기

العربية:
محول YAML إلى JSON

Frequently asked questions

How do I convert YAML to JSON online?

Paste your YAML into the left panel and the JSON equivalent appears on the right instantly. Use the swap button to go the other direction (JSON to YAML). Click Copy to grab the output.

What is the difference between YAML and JSON?

Both represent the same data structures (objects, arrays, strings, numbers, booleans). YAML uses indentation and is human-readable — common for config files (Kubernetes, Docker Compose, CI pipelines). JSON uses braces and brackets — standard for APIs and web data exchange. They're easily convertible in both directions.

When should I use YAML instead of JSON?

Use YAML for configuration files humans will edit — supports comments, multi-line strings, and is less cluttered. Use JSON for machine-to-machine data exchange — stricter syntax means fewer parsing ambiguities, and it's natively supported in JavaScript.

Why is my YAML converting to JSON incorrectly?

The most common YAML bug is indentation — YAML uses spaces (never tabs) and is strict about alignment. Also watch for unquoted strings that look like booleans (yes, no, on, off all parse as booleans in YAML 1.1). When in doubt, quote your strings.

Does this tool handle YAML anchors and references?

Yes. YAML anchors (&name) and aliases (*name) are resolved during conversion — the output JSON contains the expanded values. Note this means the JSON loses the DRY benefit; reconverting to YAML won't automatically re-create the anchors.