Skip to content

JSON to YAML Converter

Convert JSON to YAML 1.2 as you type. Strings that YAML would read as numbers or booleans keep their quotes.

Input · JSON
⇄
Output · YAML
Valid JSONRuns in your browser

Load from a URL

Your browser fetches it directly, so the server must allow cross-origin requests (CORS).

How to convert JSON to YAML

  1. Paste JSON or open a .json file. The YAML updates as you type.
  2. Choose an Indent of 2 or 4 spaces.
  3. Press ⇄ to check the round trip in YAML to JSON.

Invalid JSON shows its line and column instead; common JSON errors covers the usual causes.

Example: an app config

{"service":"geo-lookup","country":"NO","cache":"off","version":"1.10","port":"8080","launch":"2026-11-05","motd":"Maintenance at 02:00.\nExpect 5 minutes of downtime.\n","regions":["eu-north-1","eu-west-1"],"limits":{"rps":50,"burst":200}}
service: geo-lookup
country: "NO"
cache: "off"
version: "1.10"
port: "8080"
launch: "2026-11-05"
motd: |
  Maintenance at 02:00.
  Expect 5 minutes of downtime.
regions:
  - eu-north-1
  - eu-west-1
limits:
  rps: 50
  burst: 200

What gets quoted

A string is quoted when any YAML parser could read it as something else: numbers such as "1.10" and "8080", "true", "null", empty strings, text containing : , and the values YAML 1.1 parsers misread, like yes, no, on, off and dates. So country: "NO" stays a country code in PyYAML and older Kubernetes tooling. Multi-line text becomes a | block, which keeps every line break. Long lines are not folded. To check a file by hand, use the YAML validator.

For pyproject.toml, Cargo.toml or a Hugo config, use JSON to TOML instead.

Questions

Is this also a JSON to YML converter?

Yes, .yml and .yaml are the same format. Download saves data.yaml; rename it if your tool wants .yml.

Can I add comments to the YAML?

Yes, after converting. JSON has none to carry over, but YAML accepts # comments on their own line or after a value.

Why does the YAML not start with ---?

One document does not need the marker. Add --- when you join several documents in one file, as Kubernetes manifests often do.

Related tools

Esc