YAML ↔ JSON Converter
Your data never leaves your browserConvert YAML to JSON or JSON to YAML with a single toggle. Bidirectional, instant, and 100% in your browser.
Share this tool
Found it useful? Help a fellow developer discover it.
Convert YAML to JSON or JSON to YAML with a single toggle. Bidirectional, instant, and 100% in your browser.
Share this tool
Found it useful? Help a fellow developer discover it.
YAML
JSON
YAML is the default format for many DevOps tools, Kubernetes manifests, Docker Compose files, GitHub Actions workflows, and Ansible playbooks are all YAML. JSON is the wire format for REST APIs, browser storage, and most configuration SDKs. You will often need to convert in both directions: copying a Kubernetes resource to pass to a JSON API, or taking a JSON API response and writing it into a YAML config file. This tool handles both directions on a single page so you don't need two separate converters.
.json or .yaml file.Select the YAML to JSON direction using the toggle, paste your YAML into the input panel, and the JSON output appears instantly. Click Copy to copy the result to your clipboard or Download to save it as a .json file. To go the other direction, toggle to JSON to YAML and paste your JSON instead.
YAML is the configuration format for Kubernetes (manifests, Helm charts), Docker Compose, GitHub Actions, GitLab CI, CircleCI, Ansible playbooks, Azure DevOps pipelines, and many cloud infrastructure tools. When any of these tools produce output you need to pass to a JSON API, this converter bridges the gap.
The most common causes are: inconsistent indentation (YAML uses spaces, never tabs), a missing colon after a key, a scalar value that YAML is interpreting as a different type (wrap it in quotes to force a string), or a YAML anchor that resolves unexpectedly. The error indicator in the input panel shows where the parser failed.
No. JSON has no comment syntax, so comments are lost during YAML to JSON conversion. This is a fundamental limitation of the JSON specification, not a bug in the converter.
Yes. YAML is a superset of JSON. Every valid JSON document is also valid YAML. However, YAML supports additional types and features such as anchors, tags, and multi-document streams that have no JSON equivalent and are dropped during conversion.
js-yaml parses unquoted timestamps (for example 2024-01-15) as JavaScript Date objects by default, which JSON serializes to ISO string format. Wrap the value in quotes in your YAML to keep it as a plain string.
The converter loads the first document in a multi-document YAML stream. Subsequent documents separated by --- are ignored. Split multi-document files manually before converting if you need all documents.
YAML to JSON is lossless for the JSON data model (strings, numbers, booleans, null, arrays, objects). YAML-specific features like comments, anchors, and custom tags are dropped. JSON to YAML is fully lossless. All JSON types map cleanly to YAML equivalents.
JSON Formatter & Validator
Format, beautify, validate, and minify JSON. Detects BigInt precision issues, duplicate keys, and JSONC comments.
JSON Diff
Compare two JSON objects side-by-side and highlight differences.
TOML to JSON Converter
Convert TOML to JSON or JSON to TOML. Supports Cargo.toml, pyproject.toml, and Hugo config files. Bidirectional.
.env ↔ JSON / YAML Converter
Convert .env files to JSON or YAML and back. Handles comments, quotes, export prefixes, and nested keys. Bidirectional.