Input
Ready
Lines: 0
Words: 0
Chars: 0
Size: 0 KB
Input statistics are available via the Stats button above this field.
Output
Lines: 0
Words: 0
Chars: 0
Size: 0 KB
Output statistics are available via the Stats button above this field.
Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.
What the YAML to JSON Converter does
The YAML to JSON Converter parses YAML and outputs the same data as indented JSON. Maps become objects, lists become arrays, and numbers and booleans keep their types.
Anchors and aliases (&name and *name), including merge keys (<<:), are resolved, so the JSON contains the full values. Comments are dropped, because JSON has no place for them.
When to use it
- Reading a YAML config in a program or API that only accepts JSON.
- Checking what a YAML file actually contains. Indentation mistakes often become obvious once you see the JSON structure.
- Feeding a Kubernetes or CI configuration into a JSON-based tool such as jq.
Worked example
Input
server:
host: localhost
port: 8080
features:
- auth
- logging
Output
{
"server": {
"host": "localhost",
"port": 8080
},
"features": [
"auth",
"logging"
]
}Common questions about the YAML to JSON Converter
Does it support files with several documents separated by ---?
No. The converter expects a single YAML document. Split a multi-document file (common in Kubernetes) and convert each part separately.
Why did my value change type?
YAML guesses types from plain text: 8080 is a number and true is a boolean. Quote a value in the YAML, for example "8080", if you need it to stay a string.
What if the YAML has an indentation error?
Conversion stops with an error. The YAML Validator helps you find it. YAML indentation must use spaces, not tabs.