What is the YAML to JSON?
Paste a Kubernetes manifest, Docker Compose file, GitHub Actions workflow, OpenAPI spec or any other YAML, and get the same data as JSON. JSON is what most APIs, browsers and programming languages read natively.
The converter follows YAML 1.2. Anchors and aliases (&name and *name) are expanded, files with several documents separated by --- become a JSON array, and duplicate keys or indentation mistakes are reported with the exact line and column.
How to use it
- Paste YAML, upload a .yaml or .yml file, or click Example.
- Choose the JSON indentation.
- The JSON appears as you type; errors point to the line to fix.
- Copy the JSON or download a .json file.
Example
name: nova ports: - 80 - 443 enabled: true
{
"name": "nova",
"ports": [
80,
443
],
"enabled": true
}Features
- YAML 1.2. Modern rules: yes and no stay as text, and dates stay as strings.
- Anchors and aliases. Shared blocks defined with & and reused with * are expanded in the JSON.
- Multiple documents. Files with several --- documents become a JSON array.
- Clear errors. Bad indentation, duplicate keys and broken syntax are shown with line and column.
- Exact numbers. Large integers stay exact instead of being rounded.
- Private. Your configs never leave your browser.
Frequently asked questions
Why is yes still a string in my JSON?
YAML 1.2, the current version, treats only true and false as booleans. Older YAML 1.1 tools also read yes, no, on and off as booleans. If you need true or false, write them explicitly.
What happens to comments?
JSON has no comments, so YAML comments are dropped during conversion.
How are multiple documents handled?
A file containing several documents separated by --- (common in Kubernetes) is converted to a JSON array with one item per document.
Why do I get an error about duplicate keys?
The same key appears twice in one mapping, so one value would be silently lost. Rename or remove one of them.
Is my YAML uploaded?
No. Conversion happens in your browser.
Last updated · Free, no sign-up, runs in your browser.