Skip to content
Categories
YAML to JSON
Convert YAML into JSON format.
Overview
- Converts YAML-formatted data into JSON format.
- Useful when you want to take configuration managed as YAML, such as Docker Compose, Kubernetes, or GitHub Actions, and work with it as JSON instead.
- YAML supports notation JSON doesn't have, such as anchors/aliases and comments. Anchors and aliases are resolved to their actual values during conversion, and comments are not included in the result.
Usage
- Enter the YAML you want to convert into the text area.
- Click the "Convert" button.
- The result, converted to JSON format, is displayed below. Use the "Copy" button to copy it to the clipboard.
Example
Input
name: Taro age: 20 hobbies: - reading - coding
Output
{
"name": "Taro",
"age": 20,
"hobbies": [
"reading",
"coding"
]
}Use Cases
- Reviewing the contents of a Docker Compose or Kubernetes manifest and passing it as JSON to a script or another tool
- Converting a GitHub Actions workflow configuration to read it more like JSON
- Converting YAML-formatted API responses or sample data into JSON to paste into code
FAQ
Is the YAML I enter sent anywhere?
No. The conversion runs entirely in your browser, and nothing is sent to an external server.
Are YAML comments preserved in the result?
No. Since JSON cannot contain comments, comments are discarded during conversion.
Can I convert JSON back to YAML?
Yes. Please use the "JSON to YAML" tool.
Notes
- YAML containing anchors (&) and aliases (*) is converted to JSON with aliases expanded to their referenced values.
- YAML that fails to resolve, such as an alias referencing a nonexistent anchor, is shown as an error.
- Converting very large YAML data (several MB or more) may make browser processing slow.
Related Tools
Convert JSON into YAML format.
Format YAML to make it easier to read.
Validate whether YAML syntax is correct.