YAML to JSON Converter
Convert YAML to JSON and JSON to YAML — for config files, CI pipelines, and Kubernetes manifests.
Last updated: March 25, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is YAML to JSON Converter?
YAML ("YAML Ain't Markup Language") and JSON are both text-based data serialization formats that represent the same underlying data model — maps, sequences, and scalar values. YAML uses human-readable indentation with minimal punctuation, making it the preferred choice for configuration files and developer tooling. JSON uses explicit braces and brackets, making it the preferred choice for APIs and data interchange.
In modern DevOps, you encounter YAML daily: Kubernetes manifests, GitHub Actions workflows, GitLab CI pipelines, Docker Compose files, Ansible playbooks, and Helm charts are all YAML. Being able to convert between YAML and JSON is essential when integrating YAML-configured systems with JSON-based APIs, or when debugging a configuration by converting it to the more explicitly structured JSON format. This tool converts in both directions instantly in your browser.
How to Use YAML to JSON Converter
Select the conversion direction: "YAML → JSON" or "JSON → YAML" using the toggle
Paste your YAML or JSON into the input panel
The converted output appears in real time in the right panel
If converting JSON to YAML, set the indentation level (2 or 4 spaces)
Click "Copy" to copy the output, or "Download" to save as a file
Common Use Cases
- Converting GitHub Actions workflow YAML to JSON for automated parsing or validation
- Transforming Kubernetes manifest files to JSON for use with kubectl --output json
- Converting Docker Compose YAML to JSON for processing by a custom deployment script
- Transforming Ansible playbook YAML into JSON for integration with Ansible Tower API
- Debugging Helm chart values.yaml by converting to JSON for easier structure inspection
- Converting Swagger/OpenAPI YAML specs (common in API tools like Insomnia) to JSON
- Transforming a JSON config file to YAML for a cleaner, comment-friendly version
- Checking if a YAML file parses correctly before using it in a CD pipeline
Example Input and Output
Converting a Kubernetes deployment manifest from YAML to JSON:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
labels:
app: web
spec:
replicas: 3
selector:
matchLabels:
app: web{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "web-app",
"labels": { "app": "web" }
},
"spec": {
"replicas": 3,
"selector": {
"matchLabels": { "app": "web" }
}
}
}Privacy First
All YAML/JSON parsing runs in your browser using js-yaml. Your configuration files — which often contain environment variables, secrets references, and infrastructure details — are never sent to our servers.
Kubernetes Tip
You can use kubectl get deployment web-app -o json to get a live JSON representation of any Kubernetes resource. Converting your static YAML manifest to JSON first helps you compare against the running state and spot drift.
OpenAPI/Swagger Note
Swagger and OpenAPI specs are often maintained in YAML for readability but many tools (like Postman import) require JSON. Convert your openapi.yaml to openapi.json with this tool for cross-tool compatibility. Both formats are fully equivalent and interchangeable.
Frequently Asked Questions
Are YAML comments preserved when converting to JSON?
What is the difference between YAML and JSON in practice?
What YAML features don't have JSON equivalents?
Does this support YAML 1.2 (the modern standard)?
Can I convert multi-document YAML (files with --- separators)?
Why does my YAML number look wrong in JSON?
How This Tool Works
For YAML → JSON: the input is parsed using js-yaml's safeLoad() function, which builds a JavaScript object model with full YAML 1.2 schema support. The result is serialized to JSON with JSON.stringify(). For JSON → YAML: the JSON is parsed with JSON.parse() and then serialized using js-yaml's dump() function, with indentation and line-width settings applied. Both directions run synchronously in the browser — no server calls are made.
Technical Stack
JSON Workflow
Move between formatting, querying, transforming, and converting structured data without losing context.