Skip to content
Free Tool Arena

File & Format Converters · Free tool

YAML ↔ JSON Converter

Quickly convert YAML to JSON or JSON to YAML online. Paste on one side and copy the result instantly for configs or data — free tool that runs right in your browser.

Updated June 2026

YAML input

JSON output

Supports scalars, nested mappings, and sequences with block (-) or flow ([ ], { }) syntax. Tabs are not valid indentation in YAML.

Found this useful?EmailBuy Me a Coffee

Advertisement

What it does

A free two-way YAML ↔ JSON converter. Paste YAML to get JSON, or paste JSON to get clean YAML — then hit Swap to bounce in the other direction with the output promoted to the new input. Supports nested mappings, block and flow sequences, strings, numbers, booleans, and null.

YAML is the config-file default for Kubernetes, GitHub Actions, Docker Compose, Ansible, and most dev tooling. JSON is the default for APIs and JavaScript. Translating between them is an everyday task. Tip: YAML disallows tab characters in indentation — if a paste errors, check for mixed tabs and spaces.

Embed this tool on your siteShow snippet

Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.

<iframe src="https://freetoolarena.com/embed/yaml-json-converter" width="100%" height="720" frameborder="0" loading="lazy" title="YAML ↔ JSON Converter" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>
Embed docs →

How to use it

  1. Pick the direction you want: YAML → JSON or JSON → YAML.
  2. Paste or type in the top box.
  3. Read the output instantly in the bottom box — errors show inline.
  4. Hit Swap to flip direction and continue iterating.

When to use this tool

  • Translating Kubernetes manifests between team conventions (some prefer JSON, others YAML).
  • Converting GitHub Actions workflow YAML to JSON for programmatic generation.
  • Migrating Docker Compose YAML to a JSON-based orchestration tool.
  • Translating an OpenAPI spec between YAML and JSON formats.

When not to use it

  • When you need to preserve YAML comments — convert manually or use yq.
  • Documents using YAML 1.1 quirks that may not be detected — verify with explicit tests.
  • Very large config files (5MB+) — browser performance suffers.

Common use cases

  • Convert kubectl-output JSON to YAML for committing to a Git repo as a manifest.
  • Translate a docker-compose.yml to JSON for parsing in a Node.js automation script.
  • Move OpenAPI 3.0 specs between YAML (human edits) and JSON (build-time consumption).
  • Cross-reference a Helm chart's values.yaml against the schema's JSON representation.

Frequently asked questions

Does it preserve comments?
YAML-to-JSON loses comments (JSON doesn't support them). JSON-to-YAML has no comments to preserve. For comment-critical conversions, use a tool like yq which can preserve some metadata.
What about YAML anchors and aliases?
The converter expands anchors and aliases during YAML-to-JSON conversion — the resulting JSON has each referenced value inlined.
Which YAML spec?
YAML 1.2 — the current standard. This handles the 'Norway problem' (no as boolean) correctly, unlike older 1.1 parsers.
Max file size?
Up to about 2 MB for smooth browser performance. Larger documents may cause UI lag since parsing happens client-side.
Why use YAML over JSON?
YAML pros: human-readable for config files, supports comments, less syntactic noise (no quotes around keys, no commas at line ends), standard for Kubernetes/Docker Compose/GitHub Actions/Ansible. JSON pros: faster to parse, strict syntax (less ambiguity), universal language support, native to JavaScript. Use YAML for configuration humans will edit by hand; use JSON for API payloads, data interchange, and programmatic generation. Many systems support both: Kubernetes accepts JSON manifests, but YAML is the convention. JSON is faster to parse but YAML is more pleasant to read.
What's the difference between YAML 1.1 and 1.2?
YAML 1.1 (2005): 'yes', 'no', 'on', 'off' parse as booleans. The famous 'Norway problem': country code 'NO' parsed as false, breaking config files. YAML 1.2 (2009): only 'true' and 'false' (case-insensitive) parse as booleans; 'yes'/'no' stay as strings. Most modern parsers (PyYAML 5+, js-yaml 4+) default to 1.2 mode. If parsing legacy YAML, you may need explicit 1.1 mode or quote ambiguous values: country: 'NO' vs country: NO.

Advertisement

Learn more

Explore more file & format converters tools

100% in-browserNo downloadsNo sign-upMalware-freeHow we keep this safe →

Found this useful?

The tools stay free thanks to readers who chip in or spread the word.

Buy Me a Coffee