YAML to JSON converter.
Convert YAML, JSON, or TOML with anchor detection and key-depth stats. Paste config, see nesting depth, copy output — free converter, no signup.
Paste YAML or JSON to convert
Auto-detects direction, supports multi-doc YAML, and exports JSON, YAML, or TOML.
How to use the YAML to JSON converter
- Paste your YAML or JSON into the input panel.
- The converter auto-detects the format and converts to the other.
- Use tabs for multi-document YAML, toggle minify for compact JSON.
What are YAML and JSON?
YAML (YAML Ain't Markup Language) and JSON (JavaScript Object Notation) are both data serialization formats used for configuration files, API payloads, and data exchange. JSON uses braces and brackets with strict syntax, while YAML uses indentation and is more human-readable. Our yaml to json converter handles the translation between these formats. JSON is preferred for APIs and JavaScript, while YAML is common in Docker Compose, Kubernetes manifests, CI/CD configs (GitHub Actions, GitLab CI), and Ansible playbooks. This tool auto-detects the input format and converts in both directions, validating syntax along the way.
Frequently asked questions
How does auto-detection work?+
If your input starts with { or [, it's treated as JSON and converted to YAML. Otherwise, it's treated as YAML and converted to JSON.
Does it support multi-document YAML?+
Yes! YAML files with multiple documents separated by --- are split into tabs. You can view and convert each document individually.
Can I minify the JSON output?+
Yes. Enable the 'Minify' toggle to get compact, single-line JSON output without whitespace.
Does it preserve comments?+
YAML comments (lines starting with #) are stripped during conversion because JSON has no comment syntax. This is a limitation of the JSON format itself.
Is JSON output pretty-printed?+
Yes by default, using 2-space indentation. Toggle Minify for compact output.