Skip to main content

YAML Linter & Validator

Paste your YAML to get real-time lint feedback with exact line numbers, column positions, and actionable fix suggestions. Catches errors and best-practice violations that basic validators miss.

✓ Syntax errors with line & column ✓ Unquoted boolean keys & ambiguous values ✓ Deep nesting, long lines & trailing whitespace

Frequently Asked Questions

What is a YAML linter and why do I need one?▼

A YAML linter is a tool that checks your YAML files for both syntax errors (things that will crash your parser) and style/best-practice warnings (things that may cause subtle bugs or confusion). Unlike a simple validator that only tells you if the file is parseable, a linter also flags risky patterns like unquoted boolean keys, deeply nested structures, and ambiguous values like 'yes' or 'no' that different YAML parsers may interpret differently.

Why are 'yes', 'no', 'on', and 'off' flagged as warnings?▼

In YAML 1.1 (used by many tools including PyYAML and older Ruby parsers), the values 'yes', 'no', 'on', and 'off' are treated as boolean true/false. In YAML 1.2 (the current spec), only 'true' and 'false' are booleans. This means a config file that works with one tool may silently break with another. The safe practice is to always quote these values: '"yes"' or '"no"' when you intend them as strings.

What does 'unquoted boolean key' mean?▼

In YAML, mapping keys are parsed the same as values. A key written as 'yes:' or 'true:' is technically a boolean key, not a string key. Most parsers will coerce it back to the string 'true', but behavior is inconsistent across implementations. Writing '"yes": value' or '"true": value' ensures the key is always treated as a string regardless of the YAML spec version being used.

Why does YAML require spaces instead of tabs for indentation?▼

The YAML specification explicitly forbids tab characters for indentation. Tabs cause ambiguity because different editors and systems may display or expand them differently (4 spaces? 8 spaces?). The spec mandates spaces so that indentation levels are unambiguous. If your editor inserts tabs, configure it to use spaces (or 'expand tabs') for YAML files.

What is a 'deeply nested structure' warning and how do I fix it?▼

When your YAML mapping nests more than 5 levels deep (e.g., config.server.tls.certs.ca.path), it becomes hard to read and maintain, and is also a common sign that the data model should be restructured. Fixes include: splitting into separate YAML files and referencing them, using YAML anchors (&anchor) and aliases (*alias) to share repeated sub-trees, or flattening the structure with dotted keys.

What does the Format / Indent button do?▼

The Format button normalizes your YAML indentation to a consistent 2-space style. It detects your current indentation unit (e.g., 4-space or mixed), computes nesting levels, and rewrites each line's leading whitespace to multiples of 2 spaces. The YAML content itself is not changed — only the leading whitespace is normalized. Blank lines and comments are preserved as-is.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →