YAML Linter

Lint YAML for syntax errors, duplicate keys, and common gotchas

Ad placeholder (leaderboard)

YAML is whitespace-sensitive and quietly forgiving, which makes its failure modes especially nasty: a tab where a space belongs, two keys with the same name where only the last survives, or an unquoted yes that silently becomes a boolean. This YAML linter scans for those exact gotchas in your browser and explains each one.

How it works

The linter walks your file line by line, tracking quote state so that a # or colon inside a string is not mistaken for a comment or a mapping separator. For each line it checks several rules:

  • A tab character in the indentation is an error, because YAML forbids tabs for indentation.
  • Two keys at the same indent under the same parent are reported as a duplicate-key error; in real YAML only the last would win.
  • A mapping colon must be followed by a space or end of line, so key:value is flagged.
  • Flow collections must have balanced [ ] and { } on the line.
  • Trailing whitespace is reported as a warning.

Ambiguous values

YAML 1.1 coerces bare words like yes, no, on, and off into booleans, and a value such as 0755 can be read as octal. The linter warns on these so you can quote them when you mean the literal string or number. For example, in the sample, version: 01.2 and enabled: yes both raise warnings.

Notes

This is a practical linter, not a complete YAML processor — it targets the mistakes that cause real outages rather than building a full document model. Use it as a fast first pass, then load the file through your own application’s parser to confirm the final structure. Everything runs locally, so configs containing secrets stay private.

Ad placeholder (rectangle)