curly{bits}

curlybits / JSON to YAML

JSON to YAML Converter

Paste JSON and get tidy YAML for config files, Kubernetes manifests or CI pipelines, converted as you type. Strings are quoted only when YAML needs it, and JSON errors show the exact line and column.

Input JSON
YAML

      

How to use the JSON to YAML Converter

  1. Paste your JSON into the left box, or click Load sample.
  2. The YAML appears on the right as you type. Pick the indentation and whether to sort keys.
  3. Click Copy and paste it into your .yml or .yaml file.

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

Why are some strings quoted?

Values that YAML would otherwise read as something else, like "yes", "123" or text with a colon, are quoted so they stay strings.

Can I convert invalid JSON?

No. Fix it first with the JSON formatter, which can repair trailing commas and quotes automatically.

Is my data uploaded?

No. Everything runs in your browser.

Add this JSON to YAML 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 ↗