Free tool

YAML to JSON Converter

Convert YAML to JSON and back, entirely in your browser.

Output

Paste YAML to get JSON, or switch direction to go the other way. It handles the things real configuration files contain: nested mappings, lists, lists of objects, quoted strings, block scalars and inline flow collections. Everything runs in your browser tab.

YAML is a superset of JSON, so any JSON is already valid YAML, but the reverse is not true and a few YAML features have no JSON equivalent at all. Anchors and aliases, tags, multiple documents in one file and merge keys are all outside what a plain conversion can express, and this converter reports them rather than guessing. Comments are dropped, because JSON has nowhere to put them.

How to use it

  1. Paste your YAML into the input.
  2. Read the JSON on the right, or switch the direction to convert JSON to YAML.
  3. If parsing fails, the error names the line so you can go straight to it.
  4. Copy the result when it looks right.

Frequently asked questions

Which YAML features are not supported?

Anchors and aliases (&name and *name), explicit tags (!!str and similar), multiple documents separated by ---, merge keys (<<) and complex mapping keys. These have no direct JSON equivalent, so rather than guess, the converter tells you which one it found and on what line.

What happens to my comments?

They are dropped when converting to JSON, because JSON has no comment syntax. This is why editing YAML in place is preferable to a round trip through JSON if the comments matter to you.

Why is my indentation an error?

YAML forbids tabs for indentation, which is the single most common cause. Editors that insert a tab silently break the file. Use spaces, and keep sibling keys at exactly the same column.

Why did my version number become a string?

Because 1.2.0 is not a number. A single dot parses as a float, so 1.2 becomes the number 1.2, while 1.2.0 stays a string. This is a frequent surprise in version fields, and quoting the value makes the intent explicit.

Is JSON valid YAML?

Yes. YAML 1.2 is a strict superset of JSON, so you can paste JSON into a YAML parser and it will work. That is why the flow syntax here, [1, 2] and {a: 1}, looks exactly like JSON.

The desktop version

YAML to JSON Converter in Toolbelt

This page does the job in a browser tab. Toolbelt is the same tool as a native Mac app, plus the things a web page cannot do.

Toolbelt

Tools

Input
{"name":"Holizmi","tools":["json","jwt","base64"],"live":true}
Output
{
  "name": "Holizmi",
  "tools": [
    "json",
    "jwt",
    "base64"
  ],
  "live": true
}
Valid JSON. 4 keys, 96 characters.K to switch tools
  • Convert a folder of config files in one run
  • Validate every YAML file in a repository at once
  • Preserves comments when editing YAML in place
  • Works with no connection at all

Coming soon·$29 one-time purchase

One email when it ships. Nothing else, ever.

Everything Toolbelt does

macOS 14+ · Mac App Store

Free tools, forever.

These stay free and run in your browser. The paid Mac app is for when you want them native, offline and on a keyboard shortcut.