JSON ⇄ YAML Converter

Switch config files between JSON and YAML. Parse errors show the exact line so you can fix indentation mistakes fast.

✓ Runs locally in your browser — nothing is uploaded

In short: A JSON to YAML converter rewrites the same data structure between JSON’s braces-and-quotes syntax and YAML’s indentation-based syntax, as used in Kubernetes, Docker Compose and CI configs.

About JSON ⇄ YAML Converter

YAML and JSON describe the same kinds of data — maps, lists, strings, numbers and booleans — but people prefer YAML for hand-edited configuration (Kubernetes, Docker Compose, GitHub Actions, Ansible) while programs and APIs prefer JSON. Converting by hand is tedious and error-prone, especially with YAML’s significant indentation.

This converter uses js-yaml, a widely used, specification-compliant YAML 1.2 parser. JSON → YAML output uses two-space indentation and block style that reads naturally. YAML → JSON reports syntax errors with line and column numbers, and supports multi-document files separated by ---, converting them into a JSON array.

How to use JSON ⇄ YAML Converter

  1. Paste JSON or YAML into the input box.
  2. Press JSON → YAML or YAML → JSON.
  3. If there is an error, check the reported line — tabs used for indentation are a common culprit in YAML.
  4. Copy the converted output.

Examples

Kubernetes Service

The sample JSON becomes a familiar YAML manifest with apiVersion: v1, kind: Service and nested spec.ports.

The “Norway problem”

In older YAML 1.1 parsers, country: NO turned into false. js-yaml follows the YAML 1.2 core schema, so it stays the string "NO".

Frequently asked questions

Are YAML comments preserved?

No. JSON has no comments, so comments are dropped when converting YAML to JSON.

Why does my YAML fail with “bad indentation”?

YAML forbids tab characters for indentation and requires consistent spaces at each level. Replace tabs with spaces and align sibling keys.

Can it handle anchors and aliases?

Yes. Anchors (&base) and aliases (*base) are expanded into full copies in the JSON output.

Is my config uploaded?

No. Configs often contain hostnames or secrets, so conversion runs entirely in your browser.

Updated November 2026 · Free, no signup · How we build and test tools

Related tools All developer tools →