Skip to content
toolstome

YAML ⇄ JSON converter and validator

Turn YAML configuration files into JSON for APIs and scripts, or JSON into clean, readable YAML for Kubernetes, Docker Compose, GitHub Actions and similar tools. The converter follows YAML 1.2, resolves anchors and aliases, rejects duplicate keys and points to the exact line and column of any syntax error. You can also reformat a YAML file with consistent indentation while keeping its comments.

Free · No sign-upProcessed in your browser

Convert

Indentation

How to use the YAML to JSON Converter

  1. 1

    Choose the direction

    Pick YAML to JSON, JSON to YAML, or Format YAML.

  2. 2

    Paste your data

    The result updates as you type.

  3. 3

    Fix any errors

    If the input is invalid, the line and column of the problem are shown.

  4. 4

    Copy or download

    Copy the output or save it as a .json or .yaml file.

How YAML maps to JSON

JSON is a subset of YAML 1.2: mappings become objects, sequences become arrays, and plain scalars become strings, numbers, booleans or null. Anchors (&) and aliases (*) are expanded into copies.

YAML comments, styles and key order are not part of the data, so they are lost when converting to JSON. Formatting YAML keeps comments.

  • key: value → {"key": "value"}
  • - a\n- b → ["a", "b"]

When to use it

  • Convert a Kubernetes or Compose file to JSON for a script or API.
  • Turn a JSON API response into readable YAML.
  • Find the exact indentation error that breaks a CI pipeline file.

Limits

  • Multi-document YAML (separated by ---) converts the first document only.
  • Custom YAML tags are read as plain values.

Privacy

Conversion happens entirely in your browser. Configuration files and secrets are never uploaded.

Frequently asked questions

Why does my YAML fail to parse?

The most common causes are mixed tabs and spaces, wrong indentation and an unclosed bracket or quote. The error shows the line and column to check.

Are comments kept?

Formatting YAML keeps comments. Converting to JSON drops them, because JSON has no comments.

Why are 'yes' and 'no' not converted to true and false?

This tool follows YAML 1.2, where only true and false are booleans. Older YAML 1.1 tools treated yes, no, on and off as booleans.

Are duplicate keys allowed?

No. Duplicate keys are an error in YAML 1.2, so the tool reports them instead of silently keeping one.

What happens to anchors and aliases?

They are expanded in the JSON output, so every alias becomes a full copy of the anchored value.

Is my file uploaded?

No. Everything runs in your browser.

People also use

Last updated November 20, 2026 · How we build and test our tools

Categories

Recently used tools

Tools you open will appear here.

More