JSON to YAML Converter

Paste JSON, get clean YAML

Input (JSON)

Output (YAML)

JSON to YAML Converter guide

YAML is the config language of Kubernetes, Docker Compose, GitHub Actions, and most CI tools, but APIs and scripts speak JSON. This converter turns JSON into YAML you can drop straight into a config file.

How it converts

  • Objects. Each key becomes a YAML key, with nested objects indented 4 spaces.
  • Arrays. Each item becomes a line starting with a dash.
  • Strings. Values that YAML would misread, such as dates or numbers stored as text, are quoted so they stay strings.

Example

A small JSON object:

{ "app": { "port": 8080, "hosts": ["a.local", "b.local"] } }

// converts to

app:
    port: 8080
    hosts:
        - a.local
        - b.local

Frequently asked questions

Does it keep the order of my keys?
Yes. Keys come out in the same order they appear in your JSON.
Why are some of my values in quotes?
YAML treats unquoted text like 2024-01-01 or 042 as dates or numbers. The converter quotes those values so they stay strings, exactly as they were in your JSON.
Can I paste a JavaScript object instead of JSON?
No. The input must be strict JSON, so keys need double quotes and trailing commas are not allowed. For a JavaScript object, quote the keys first.