YAML ↔ JSON Converter

Convert YAML to JSON, or JSON to YAML. Handy for Kubernetes manifests, Docker Compose files, and GitHub Actions workflows — errors show exactly which line and column caused the problem. Nothing is sent to a server — everything runs in your browser.

Input YAML
Output JSON

How to use

  1. Pick a direction: use the "YAML → JSON" or "JSON → YAML" button to choose the conversion direction.
  2. Input: paste into the left box, use "Open file" to upload a .yaml/.yml/.json file, or drag a file onto the page. Opening a file automatically switches direction to match its extension.
  3. Check the result: the right panel updates live. Errors show exactly which line and column caused the problem.
  4. Export: copy the result to your clipboard or download it as a file.

Everything runs inside your browser (JavaScript) — nothing you enter is sent to a server or stored.

How is YAML different from JSON?

YAML and JSON can both represent the same data structures — objects, arrays, strings, numbers, booleans, and null — and are largely interchangeable. JSON marks structure explicitly with braces and quotes, which makes it easy for machines to parse; YAML uses indentation and minimal punctuation, which makes it easier for humans to read and write. That's why config files like Kubernetes, Docker Compose, GitHub Actions, and Ansible are usually written in YAML, while API responses and program-to-program data exchange are usually JSON. In fact, every valid JSON document is also valid YAML — YAML 1.2 is a strict superset of JSON.

Frequently Asked Questions

Is my data sent anywhere?

No. All parsing and conversion happens in JavaScript inside your browser and is never sent to a server.

Does this support YAML anchors (&) and aliases (*)?

Yes. When converting YAML to JSON, anchor/alias references are resolved and expanded into their actual values. Converting JSON to YAML, however, never re-introduces anchors — repeated structures are always written out in full each time.

Does this support multi-document YAML (files separated by ---)?

No. This tool assumes a single document per file — for a file with multiple ----separated documents, only the first one is converted.

What happens to comments?

YAML's # comments have no equivalent in JSON, so they're dropped when converting YAML to JSON. Converting JSON to YAML likewise outputs plain data with no comments.

Why do I get a "bad indentation" error?

YAML uses indentation to express structure, so mixing tabs and spaces or using inconsistent indent widths causes an error. Check the indentation near the line/column shown in the error message.