YAML to JSON Converter
Convert YAML to JSON using a real YAML parser - handles nested mappings, sequences, and scalar types correctly.
Paste YAML below - this tool parses it with a real YAML parser and outputs clean, formatted JSON.
More File & Data Conversion Tools
View all 20For the reverse direction, see the JSON to YAML Converter.
How to Use It
- Paste valid YAML.
- Click Convert.
- Copy or download the resulting JSON.
Understanding the Result
YAML mappings become JSON objects, sequences become arrays, and scalar types (strings, numbers, booleans, null) are preserved according to YAML's own type inference rules.
Common Errors
YAML is indentation-sensitive - a common source of parse errors is mixing tabs and spaces, or inconsistent indentation between sibling keys. This tool reports the parser's error message to help pinpoint the issue.
Example
# service settings
server:
host: example.com
ports: [80, 443]
tls: true
users:
- name: asha
admin: true
- name: ravi
becomes:
{
"server": {
"host": "example.com",
"ports": [
80,
443
],
"tls": true
},
"users": [
{
"name": "asha",
"admin": true
},
{
"name": "ravi"
}
]
}
The comment is dropped, because JSON has no comments.
Why Convert YAML to JSON?
- Checking how a Kubernetes, Compose or CI file is really structured when indentation is confusing.
- Sending YAML-authored data to an API or tool that only accepts JSON.
- Comparing two configs as JSON, or querying them with
jq.
Fixing Common YAML Errors
- Tabs: YAML indentation must use spaces.
- Missing space after a colon:
key:valueis a single string; writekey: value. - Special characters: quote values that start with
@,*,&,{or contain:. - Uneven indentation: sibling keys must line up exactly.
Convert back with JSON to YAML. For Kubernetes manifests, also try the Kubernetes Manifest Validator.
Frequently Asked Questions
Explore More Tools
Keep going with related categories and our most used tools.