YAML to JSON Converter
Parse YAML configuration files, CI/CD pipelines, or data documents into valid JSON instantly. Options include pretty-printed output for readability and experimental comment preservation so your annotations are not silently dropped. All conversion runs client-side in your browser — just paste your YAML and download the result.
YAML
Output Options
JSON
What is YAML to JSON Converter?
YAML's human-readable syntax is great for writing configs by hand, but it becomes a liability when you need to process, query, or transform the data programmatically. jq does not speak YAML. Most REST API clients do not either. Converting your Kubernetes manifests, Helm values files, or GitHub Actions workflows to JSON makes them immediately processable by the entire JavaScript and Python tooling ecosystem. This converter handles every YAML feature that trips up simpler parsers: anchors and aliases are fully resolved before output, YAML 1.1 booleans (yes, no, on, off) and YAML 1.2 booleans (true, false) are both correctly mapped to JSON boolean values. Multi-line block scalars preserve or fold newlines as appropriate. Comments are discarded, as the JSON data model has no comment concept.
How to Use
- 1
Paste Your YAML
Paste your YAML document into the input panel or drag-and-drop a .yml or .yaml file. The parser highlights indentation errors and tab/space mixing issues before conversion.
- 2
Set JSON Output Format
Choose 2 or 4-space indentation for pretty-printed JSON, or select "Minified" to produce compact single-line output for programmatic consumption by jq or API requests.
- 3
Parse YAML to JSON
Click "Convert to JSON". Anchors and aliases are fully resolved before output, YAML type coercions are respected, and the result appears with JSON syntax highlighting.
- 4
Copy or Download the JSON
Copy the JSON output to pipe into jq, paste into a REST client like Postman or Insomnia, or download as a .json file for further processing in Python, Node.js, or shell scripts.
Common Use Cases
Kubernetes Config Inspection
Convert Kubernetes YAML manifests to JSON to query them with jq, process them in Python scripts, or inspect values programmatically without YAML parsing libraries.
CI/CD Pipeline Debugging
Translate GitHub Actions, GitLab CI, or CircleCI YAML workflow files into JSON to validate job configurations, check step ordering, and debug pipeline logic in JSON-native tools.
API Payload Construction
Author request payloads in human-friendly YAML (with comments and multi-line strings), then convert to JSON before sending to REST APIs that require a JSON body.
Cross-Framework Config Migration
When migrating between frameworks with different config formats, convert YAML configs (Ansible, Helm, Hugo) to JSON for processing with JavaScript tooling or importing into JSON-based systems.
Conversion Examples
Kubernetes Deployment YAML → JSON
Convert a Kubernetes manifest to JSON for programmatic processing.
Input JSON
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
namespace: default
spec:
replicas: 3
selector:
matchLabels:
app: my-appOutput CSV
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {"name": "my-app", "namespace": "default"},
"spec": {
"replicas": 3,
"selector": {"matchLabels": {"app": "my-app"}}
}
}YAML with Anchors → Resolved JSON
YAML anchors and aliases are fully resolved in the JSON output.
Input JSON
defaults: &defaults timeout: 30 retries: 3 production: <<: *defaults host: api.example.com staging: <<: *defaults host: staging.example.com
Output CSV
{
"defaults": {"timeout": 30, "retries": 3},
"production": {"timeout": 30, "retries": 3, "host": "api.example.com"},
"staging": {"timeout": 30, "retries": 3, "host": "staging.example.com"}
}