YAML to JSON converter
Simply convert YAML to JSON with this online live converter.
About YAML to JSON converter
Parses a YAML document and outputs the same data as indented JSON. Useful for feeding configuration files to tools and APIs that only speak JSON, or for checking exactly how a YAML file is interpreted.
When you would use it
- Converting a Kubernetes manifest, a Compose file or a CI workflow into JSON for an API call or a script.
- Seeing how YAML's implicit typing read your values: which ones became numbers, booleans or null.
- Finding indentation mistakes in a YAML file, since invalid YAML is flagged with an error.
How to use it
- Paste the YAML into the left field.
- Read the JSON on the right, indented with three spaces.
- Copy the result with the copy button.
Things worth knowing
- YAML types values implicitly: unquoted true and false become booleans, 1.10 becomes the number 1.1, and an empty value or ~ becomes null. This parser follows YAML 1.2, so yes, no, on and off stay strings. If a value came out as the wrong type, quote it in the YAML.
- Merge keys (<<: *defaults) are resolved, and anchors and aliases are expanded, so the JSON contains the merged, duplicated data.
- Multi-document files (sections separated by ---) are rejected with an error; convert one document at a time.
- Comments are lost, because JSON has no comments.
Frequently asked questions
- Why did my version number 1.10 become 1.1?
- Unquoted 1.10 is a floating-point number in YAML, and numbers do not keep trailing zeros. Write it as "1.10" with quotes to keep it a string.
- Why is the output empty with no error?
- The YAML parsed to an empty value, for example a file with only comments. Make sure the document contains at least one key or list item.