YAML to JSON converter

Convert YAML to JSON in your browser: nothing is uploaded, there is no limit on the size, and invalid YAML shows the line and character of the error, so it works as a validator too.

Indent

How it works

  1. Paste your code

    Paste the code in the left box or open a file. No code to hand? Click Example.

  2. Instant result

    The result appears as you type. If there is an error, you see the line and character.

  3. Copy or download

    Copy the result with one click or save it as a file for your editor or project.

What gets converted?

  • Comments with # are dropped, because JSON has no comments.
  • Anchors and aliases (&defaults and *defaults) are written out in full.
  • Multiple documents, separated by ---, are combined into one JSON array.
  • true, false, null and numbers become real JSON values; yes and no stay text (as in YAML 1.2).

Common YAML mistakes

  • Using tabs to indent. YAML only accepts spaces.
  • Uneven indentation: all keys on the same level must be indented exactly the same.
  • A colon inside a value without quotes, such as title: Note: new. Put the value in quotes.

Going the other way? Use JSON to YAML.

Configs often hold secrets

A docker-compose.yml, a Kubernetes manifest or a CI pipeline can contain passwords, tokens and internal host names. Because this converter runs in your browser, you can validate or convert real files without sending them to a server. Still, remove secrets before you share the output.

Check a file before you deploy it

Paste your YAML to see whether it parses. A converted result that looks different from what you expected shows a problem with indentation: a key that ended up in the wrong place becomes visible in the JSON structure, where nesting is explicit with braces.

The "Norway problem" and other surprises

YAML 1.1 reads yes, no, on and off as booleans, and NO (the country code for Norway) as false. This converter follows YAML 1.2, where only true and false are booleans, but other tools may still read them the old way. Quote values that could be misread. Numbers with a leading zero (0123), versions such as 1.10 and time-like values (12:30) are other classics, so quote them if you want text.

Multiple documents

A file with several documents separated by --- becomes a JSON array, one item per document. That is the usual form of a Kubernetes manifest with several resources.

To go back to YAML, use JSON to YAML. To read the JSON comfortably, see the JSON formatter.

Frequently asked questions

Which YAML version does it follow?

YAML 1.2. Only true and false are booleans. Older tools that follow 1.1 also read yes, no, on and off as booleans.

What happens to my comments?

They are dropped, because JSON has no comments.

Why does my YAML give an error?

Common causes are tabs for indentation, uneven indentation, or a colon followed by a space inside an unquoted value.

Is my YAML uploaded?

No. It is converted in your browser and never sent anywhere.