ToolsEssential

YAML to JSON Converter

Paste YAML to get JSON, or switch direction to turn JSON into clean YAML. Errors are shown with the exact line.

Both directionsError line numbersNo upload

How to convert YAML to JSON

  1. Paste your YAML (or a .yml file’s contents) into the left box.
  2. The JSON appears instantly on the right. Choose 2 or 4-space indentation.
  3. Copy or download the result. Switch to JSON → YAML to go the other way.

YAML vs JSON

YAMLJSON
SyntaxIndentation-based, minimal punctuationBraces, brackets and quotes
CommentsYes (#)No
ReadabilityVery human-friendlyMachine-friendly, still readable
Common usesDocker Compose, Kubernetes, GitHub Actions, Ansible, OpenAPIAPIs, package.json, config files, databases
Superset?YAML 1.2 is a superset of JSON—

Things to watch out for

  • Indentation matters: YAML uses spaces, never tabs. A misaligned line changes the structure — the error message shows the line and column.
  • Comments are lost when converting to JSON, since JSON has no comment syntax.
  • Unquoted values such as yes, no, on or 1.10 may be read as booleans or numbers in some parsers. Quote them to keep them as strings.
  • Multiple documents separated by --- are converted to a JSON array.
  • Anchors and aliases (& and *) are expanded into full copies.

Need to tidy the JSON further? Use the JSON formatter. Working with spreadsheets? Try the CSV to JSON converter.

Frequently asked questions

Is YAML a superset of JSON?

Yes — YAML 1.2 is designed so that any valid JSON document is also valid YAML.

Why do I get an indentation error?

YAML uses spaces for nesting. Check that items at the same level line up and that no tabs are used.

Are YAML comments kept?

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

Is my data uploaded?

No. The conversion runs entirely in your browser.

More developer tools

See all →