curly{bits}

curlybits / YAML to JSON

YAML to JSON Converter

Paste YAML from Docker Compose, Kubernetes, GitHub Actions or any config file, and get clean JSON as you type. If the YAML has a mistake, you'll see the exact line and column. Comments are dropped, and files with several --- documents become a JSON array.

Input YAML
JSON

      

How to use the YAML to JSON Converter

  1. Paste your YAML into the left box, or click Load sample.
  2. The JSON appears on the right as you type. Choose 2 or 4 spaces, and tick Sort keys if you like.
  3. If there's an error, click Go to line to jump to it.
  4. Click Copy to copy the JSON.

YAML vs JSON

YAMLJSON
StructureIndentation (spaces only, never tabs)Braces {} and brackets []
CommentsYes, with #No
QuotesUsually optionalRequired around keys and strings
Multiple documentsYes, separated by ---One value per file
Used forConfig: Docker Compose, Kubernetes, GitHub Actions, AnsibleAPIs, data exchange, package.json

Every JSON document is also valid YAML 1.2, so YAML parsers can read JSON directly. Going the other way loses comments, because JSON has no place for them.

Common YAML gotchas

  • Tabs: YAML doesn't allow tab characters for indentation. Use spaces.
  • Unquoted surprises: on, yes and no are plain strings in YAML 1.2 (which this tool follows), but older YAML 1.1 parsers read them as true or false. Quote them to be safe, like "yes".
  • Colons in values: a value like time: 12:30 or a URL with : may need quotes.
  • Leading zeros: zip: 01234 may be read as a number. Quote codes, IDs and version numbers like "3.10".

Frequently asked questions

What happens to YAML comments?

They're removed, because JSON has no comments.

What about anchors and aliases (& and *)?

They're expanded, so each place that used an alias gets a full copy of the value in the JSON.

How are dates converted?

Unquoted dates like 2026-10-24 become ISO date strings in JSON. Quote them in the YAML to keep them exactly as written.

Is my data uploaded?

No. The conversion runs in your browser with the open-source js-yaml library.

Add this YAML to JSON converter to your website

Free for blogs, schools and businesses. Copy the code below and paste it into your page's HTML. The tool works exactly like this one and runs in your visitors' browsers, so nothing is uploaded. Please keep the credit line so others can find it too.

Preview embed ↗