YAML Formatter and Validator

Paste YAML from a docker-compose file, Kubernetes manifest, GitHub Actions workflow or OpenAPI spec. If it is broken you get the line and a plain reason (a tab, a key indented too far, a duplicate key, an unclosed quote). If it is valid you get it back with consistent indentation, and you can switch to YAML to JSON or JSON to YAML in one click.

Action
YAML
YAML

Valid YAML.

Formatting rewrites the file from its data, so comments are dropped and anchors (&name) are written out in full. Values follow YAML 1.2: yes and no stay text.

Processing runs in your browser. What you type never leaves this device.

Features

  • Errors with line numbers and plain explanations

  • Consistent 2- or 4-space indentation

  • List items indented under their key, or not

  • Anchors, aliases and << merge keys resolved

  • Several documents separated by ---

  • YAML to JSON and JSON to YAML

When to check YAML

Before a deploy

A single tab or misaligned key can stop a docker-compose or Kubernetes deploy. Check the file first.

CI workflows

GitHub Actions and GitLab CI fail on the first YAML error; find it here with its line number.

Converting configs

Turn YAML into JSON for a tool that only reads JSON, or the other way round.

Common YAML mistakes

What the validator catches

  • Tabs used for indentation (YAML allows spaces only).
  • A line indented more than the lines around it.
  • The same key twice in one map.
  • Unclosed quotes, [lists] or {maps}.
  • A value containing ": " without quotes.

What formatting changes

The file is rewritten from its data, so comments are dropped and anchors are expanded into full copies. Keep your original if comments matter. Values follow YAML 1.2, where yes, no, on and off stay text; when written out they are quoted so older YAML 1.1 readers do not turn them into true or false.

YAML Formatter and Validator - FAQ