JSON ↔ YAML Converter
Convert between JSON and YAML formats. Auto-converts as you type.
Related Tools
From the makers of JSON Knife
Get the JSON & API Cheat Sheet
Formatting tricks, jq commands, and common patterns — one page, zero fluff.
How to Convert JSON to YAML (and Back)
JSON and YAML represent the same data structures, but YAML's whitespace-based syntax is often preferred for configuration files — Kubernetes manifests, Docker Compose files, CI/CD pipelines, and Ansible playbooks all use YAML. This tool converts between the two formats instantly, running entirely in your browser.
Converting JSON to YAML is useful when you've generated config data programmatically (most languages serialize to JSON easily) but need to paste it into a YAML-based system. Going the other direction — YAML to JSON — is handy when you need to feed config data into an API or tool that expects JSON.
The converter handles nested objects, arrays, multiline strings, and special YAML features. Since YAML is a superset of JSON, any valid JSON is already valid YAML, but the converter will reformat it into idiomatic YAML with proper indentation and without the curly braces. If you're working with Rust, Python, or Hugo projects that use TOML for configuration, try our JSON to TOML converter for the same bidirectional conversion in the TOML format.
Tips
- YAML is indentation-sensitive — use spaces, never tabs. Most tools expect 2-space indentation.
- Watch out for YAML's implicit typing:
yes,no,on, andoffare parsed as booleans. Quote them if you mean strings. - Multiline strings in YAML use
|(literal block) or>(folded block) — these don't have a direct JSON equivalent. - When converting Kubernetes manifests, validate the output against your cluster's API version to catch schema mismatches.