Webtools

YAML ↔ JSON

Convert between YAML and JSON

About YAML and JSON

YAML and JSON are both human-readable data serialization formats. JSON is more compact and is the lingua franca of web APIs. YAML is more readable for configuration thanks to indentation-based structure and support for comments — it's the standard for Kubernetes manifests, GitHub Actions workflows, Ansible playbooks, and many CI configs.

Most YAML data converts losslessly to and from JSON, but a few YAML features (anchors, custom tags, multi-document streams) don't have a direct JSON equivalent. This converter handles the common subset.

Frequently asked questions

Are comments preserved in YAML → JSON?
No — JSON has no concept of comments, so they're stripped in conversion. Going JSON → YAML produces a clean YAML document without comments either, since the original JSON didn't have any.
What about multi-document YAML files?
Only the first YAML document in the input is converted. For multi-document streams (separated by ---), split them and convert each separately.

Related tools

CSV ↔ JSON
Convert between CSV and JSON in either direction
SQL Formatter
Pretty-print SQL with consistent indentation
JSON Formatter
Format, validate, and minify JSON with syntax highlighting
Base64 Encoder
Encode and decode Base64 strings
Browse other categories: Word Tools· Number Tools· Text Tools· Converters· Color Tools· Time Tools· Random Generators