YAML to JSON Converter
YAML (YAML Ain't Markup Language) uses indentation-based syntax for data serialization. To convert to JSON: key-value pairs (key: value) become {"key": "value"}, dash-prefixed lists become arrays, and indented blocks become nested objects. YAML supports comments (#), multi-line strings (| or >), and anchors (&) which JSON does not. Common uses: Docker Compose, Kubernetes manifests, GitHub Actions, CI/CD pipelines.
Convert YAML to JSON instantly. Paste any valid YAML and get properly formatted JSON output. Supports nested structures, arrays, comments, and all YAML data types. Pretty print or minified output. Perfect for API payloads, config migration, and data transformation.
YAML Input
JSON Output
Quick Examples
How to Use
- 1
Paste your YAML
Paste or type YAML content into the input area — supports comments, anchors, and multi-line strings
- 2
View the JSON output
The converter instantly transforms your YAML into valid JSON with proper quoting and structure
- 3
Toggle formatting
Check "Pretty print" for readable output or uncheck for minified JSON
- 4
Try a preset
Click Docker Compose, GitHub Actions, or Kubernetes Pod to see real-world conversions
- 5
Copy the result
Click Copy to copy the JSON to your clipboard for use in APIs, configs, or code
Frequently Asked Questions
- How do I convert YAML to JSON?
- Paste your YAML into the input area and the tool converts it to JSON instantly. YAML key-value pairs become JSON object properties, dash-prefixed lists become arrays, and indented blocks become nested objects. Toggle "Pretty print" for readable output.
- Does this support Docker Compose and Kubernetes YAML?
- Yes. The converter handles all standard YAML structures including Docker Compose files, Kubernetes manifests, GitHub Actions workflows, and CI/CD pipeline configs. Click the preset buttons to see real-world examples.
- What YAML features are supported?
- The converter supports key-value pairs, nested objects, arrays (dash syntax), inline arrays [a, b], inline objects {a: 1}, comments (#), quoted strings, booleans (true/false, yes/no), null values, integers, and floating-point numbers.
- Can I get minified JSON output?
- Yes. Uncheck the "Pretty print" checkbox to get compact, single-line JSON output. This is useful for API payloads, environment variables, or any context where you need the smallest possible JSON string.
- What happens to YAML comments in the JSON?
- YAML comments (lines starting with #) are discarded during conversion because JSON does not support comments. This is by design per the JSON specification. If you need to preserve comments, keep a copy of your original YAML.
- Does this tool work offline?
- Yes. All parsing and conversion runs entirely in your browser using JavaScript. No data is sent to any server. The tool works without an internet connection once the page is loaded.