Skip to content

YAML ↔ JSON

Convert between YAML and JSON, validate and format

Input (YAML)

Paste YAML or JSON

Output (YAML)

Converted output appears here

How to use

  1. Paste YAML or JSON. Auto mode detects the format and converts to the other one.
  2. Use Format YAML to re-indent a YAML file without converting it.
  3. Click Swap to continue working with the output, then copy or download.

YAML and JSON

YAML is a superset of JSON designed to be readable by humans, which is why Kubernetes, Docker Compose, GitHub Actions and most CI systems use it. Converting to JSON is useful for programmatic processing, diffing and validation; converting to YAML is useful for configuration files. This tool uses a full YAML 1.2 parser, reports syntax errors with line numbers and never sends your configuration to a server.

Frequently asked questions

If the input parses as JSON and starts with { or [, it is converted to YAML. Anything else is treated as YAML and converted to JSON. You can force a direction with the mode buttons.