JSON / YAML Formatter

Validate, pretty-print, minify, and convert between JSON and YAML.

[local] Runs in your browser. Nothing you enter leaves your device.

JSON / YAML Formatter

How it works

JSON and YAML both describe the same kind of data: lists, key/value maps, text, numbers, and true/false. JSON uses brackets and quotes and is what most APIs speak. YAML uses indentation instead and is what you'll see in Docker Compose files, Kubernetes manifests, Ansible playbooks, and GitHub Actions.

  • Format checks the input and re-indents it (JSON stays JSON, YAML stays YAML).
  • Minify removes all the whitespace from JSON to make it as small as possible.
  • Convert reads the data and writes it out in the other format. Comments in YAML are dropped, because JSON has no comments.

Common mistakes the checker points to:

  • JSON: a trailing comma after the last item, single quotes instead of double, or unquoted keys.
  • YAML: tabs for indentation (YAML only allows spaces), or items in the same list indented by different amounts.

JSON is checked by your browser's built-in parser. YAML uses the open-source yaml library, which only reads data and never runs code from it.