How to convert JSON to YAML for config and Kubernetes files

YAML is popular for configuration (Kubernetes, Docker Compose, CI files) because it is easier to read than JSON. JSON to YAML converts for you.

Steps

  1. Paste your JSON.
  2. Choose Indent: 2 or 4 spaces.
  3. Copy the YAML.

Example

{"name":"app","ports":[80,443]} becomes:

name: app
ports:
  - 80
  - 443

Good to know

  • YAML uses indentation instead of braces. Use spaces, never tabs.
  • Invalid JSON is reported before conversion. Fix it first with JSON formatter, which shows the exact line and column.
  • Strings that look like numbers or booleans may need quotes in YAML; the converter quotes where needed.
  • This tool converts JSON to YAML only, not the reverse.

All guides

↑ ↓ navigateEnter openEsc close