About the YAML to JSON
Convert YAML configuration or data into JSON. Multi-document files (separated by ---) become a JSON array.
Key features
- Converts YAML to JSON instantly
- Multi-document YAML becomes a JSON array
- Pretty-printed or minified output
- Anchors and aliases are resolved
- Clear error messages with line numbers
- Private: runs in your browser
Convert YAML to JSON
YAML is easy to write by hand, but many APIs, tools and programming languages expect JSON. Paste YAML here to convert it instantly.
Example
service:
name: api
ports: [80, 443]
debug: false
becomes
{
"service": {
"name": "api",
"ports": [80, 443],
"debug": false
}
}
YAML vs JSON
| YAML | JSON | |
|---|---|---|
| Comments | Yes (#) | No |
| Quotes around strings | Usually optional | Required |
| Structure | Indentation | Braces and brackets |
| Typical use | Config files | APIs and data exchange |
Related tools
JSON to YAML, YAML validator, and JSON formatter.
How to use the YAML to JSON
- Paste your code into the input box, upload a file, or click Sample to try it out.
- Choose the options you want, such as indentation, line width or dialect.
- The result appears instantly in the output panel. Syntax errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.