Convert YAML to JSON
Turn YAML configs into JSON, with errors shown by line and column.
YAML input
Paste text or drop a file here (up to 50 MB).
JSON result
Convert the other way: JSON to YAML
Free to use. Your input stays in this browser.
How to use it
- Paste YAML or drop a .yaml or .yml file.
- Choose the JSON indentation.
- Copy the result or download it as a .json file.
YAML is read with the YAML 1.2 core schema. Anchors and aliases are expanded, merge keys (<<) are applied, and documents separated by --- become a JSON array.
Dates such as 2024-01-05 stay strings. Values that JSON cannot hold, such as .inf and .nan, become null.
Example
# Shared settings
defaults: &defaults
restart: always
image: nginx:1.27
services:
web:
<<: *defaults
ports:
- "80:80"
api:
<<: *defaults
image: node:22
environment:
NODE_ENV: production
DEBUG: "false"
{
"defaults": {
"restart": "always",
"image": "nginx:1.27"
},
"services": {
"web": {
"restart": "always",
"image": "nginx:1.27",
"ports": [
"80:80"
]
},
"api": {
"restart": "always",
"image": "node:22",
"environment": {
"NODE_ENV": "production",
"DEBUG": "false"
}
}
}
}