How it works
YAML ↔ JSON Converter — Convert between YAML and JSON in either direction. All processing happens in your browser — no upload, no signup, no email required. Free forever.
Last updated:
About YAML ↔ JSON Converter
YAML and JSON express the same data shapes — objects, arrays, strings, numbers, booleans, null — with very different syntaxes. YAML is friendlier for humans editing config (Kubernetes manifests, GitHub Actions workflows, Helm values), while JSON is the universal interchange format your APIs and tools speak. This bidirectional converter lets you flip between the two without copying into a Node REPL or hunting for an online tool that uploads your config.
Convert YAML → JSON when you need to feed a configuration file into a tool that only accepts JSON, when you want to validate a Kubernetes manifest with a JSON Schema, or when you want to inspect a deeply nested YAML to see exactly what gets parsed. Convert JSON → YAML when you are scaffolding a new Helm chart, writing GitHub Actions on top of an existing JSON config, or wrapping an API response into a config file you can hand-edit.
Both directions run entirely in your browser via the js-yaml library — the same parser used by countless Node.js tools. Your configuration data, which often contains environment names, internal hostnames, and even secrets you have not finished sanitising, never leaves the page. No upload, no logging, no sign-in.
How to use YAML ↔ JSON Converter
- Paste your source into the YAML side or the JSON side, depending on direction.
- Click "YAML → JSON" or "JSON → YAML" to convert into the other format.
- Adjust the Indent (2 or 4 spaces) to match your project's style.
- Read "Invalid YAML" or "Invalid JSON" if the parser rejects the input — fix the highlighted error and retry.
- Copy the converted output and paste it into your config file, manifest or test fixture.
Common use cases
- Converting a Kubernetes YAML manifest into JSON to pipe through jq or validate against a JSON Schema.
- Turning a Helm values.yaml into JSON to compare two environments with a structural diff tool.
- Reformatting an API response (JSON) into a YAML file you can hand-edit as a fixture.
- Scaffolding GitHub Actions workflows from existing JSON configurations exported by a CI tool.
- Sanity-checking that a YAML file with anchors and merge keys (<<:) resolves to the data you actually expect.
Tips & common mistakes
- YAML anchors and aliases ("&base", "*base") get fully resolved when converting to JSON because JSON has no anchor concept. The reverse direction emits plain YAML without re-introducing them.
- Watch out for YAML's "Norway problem": unquoted "NO", "yes", "on", "off" parse as booleans. If you need them as strings, quote them or convert to JSON first to see what is happening.
- JSON requires double-quoted keys and strings — YAML usually omits them. If you copy YAML into a JSON file by hand, every key needs quotes added.
- Indentation in YAML is part of the syntax. Two spaces is the de facto standard for Kubernetes, Ansible and GitHub Actions — match what the surrounding files use.
Frequently asked questions
Are anchors and aliases preserved?
When converting YAML → JSON, anchors and aliases are resolved to their referenced values (JSON has no anchor concept). The reverse direction emits plain YAML without anchors.
How are dates and special types handled?
We use the YAML 1.1 default schema. Dates parsed in YAML come out as ISO-8601 strings in JSON. Booleans, numbers and nulls are preserved as native JSON types.
Is my data uploaded?
No. Both directions of conversion run in your browser via js-yaml — nothing is sent anywhere.
Which YAML version does the parser target?
js-yaml supports the YAML 1.1 default schema with optional 1.2 modes. That is what most real-world tools (Kubernetes, Ansible, Docker Compose) consume in practice, so converting back and forth stays compatible.
Are comments preserved when round-tripping YAML through JSON?
No — JSON has no comment syntax, so YAML "#" comments are dropped on the YAML → JSON step and cannot be reconstructed. Keep an original copy if comments matter.
How are multi-document YAML files (with ---) handled?
The converter loads the first document. For multi-doc files, split on the "---" markers and convert each block separately, or wrap the documents in a JSON array yourself.
Latest from the blog
Related tools
- URL Encoder/DecoderPercent-encode and decode URI components and full URLs
- UUID GeneratorGenerate cryptographically random UUID v4 in bulk
- JWT DecoderDecode and inspect JSON Web Tokens (header, payload, expiry)
- Regex TesterTest regular expressions with live match highlighting
- Cron Expression BuilderBuild and explain cron expressions in plain language
- SQL FormatterBeautify, minify or format SQL queries for any major dialect