YAML to JSON Converter
Convert YAML configs and manifests to JSON, with anchors and aliases resolved.
YAML input
Tab inserts indentation. Press Escape, then Tab, to move focus out of the editor.
JSON output
How to convert YAML to JSON
- Paste YAML on the left, or open or drop a .yaml or .yml file.
- The JSON appears on the right as you type.
- If the YAML has an error, it's shown with its line and highlighted.
- Copy the JSON or download it as a .json file.
Full YAML support, not just the basics
Real-world YAML uses more than keys and lists. The converter uses a complete YAML 1.2 parser, so anchors (&defaults), aliases (*defaults), merge keys (<<), block strings and multiple documents are all resolved into plain JSON.
defaults: &defaults
retries: 3
prod:
<<: *defaults
url: https://api.example.com{
"defaults": { "retries": 3 },
"prod": { "retries": 3, "url": "https://api.example.com" }
}Use cases
- Read Kubernetes, Docker Compose or CI config in code that expects JSON.
- Convert an OpenAPI spec from YAML to JSON for tools that need JSON.
- Debug what a YAML file actually contains after anchors are resolved.
Related YAML and JSON tools
Convert back with JSON to YAML. If the YAML won't parse, the YAML validator explains why. Afterwards, sort or tidy the JSON with the JSON formatter, or convert spreadsheet data with CSV to JSON.
Frequently asked questions
- Are YAML anchors and aliases supported?
- Yes. Anchors (&name), aliases (*name) and merge keys (<<) are resolved, so the JSON contains the full data.
- What happens to YAML comments?
- JSON has no comments, so they are dropped. The data itself is converted completely.
- What if the YAML file has several documents?
- Documents separated by --- become a JSON array with one entry per document.
- Which YAML version is used?
- YAML 1.2, the current version. In YAML 1.2, yes and no are strings, not booleans; use true and false for booleans.