YAML Validator
Validate YAML syntax online. Check YAML for errors, indentation issues, and duplicate keys with line-level diagnostics.
About this tool
The YAML Validator checks your YAML for syntax errors, indentation problems, duplicate keys, and common pitfalls like unquoted booleans. Paste any YAML document — config files, CI/CD pipelines, Kubernetes manifests, docker-compose files — and get line-level diagnostics instantly.
Use it when you're writing Ansible playbooks, GitHub Actions workflows, Helm charts, or any YAML-based configuration and want to catch mistakes before they cause runtime failures.
Examples
Input:
server:
host: localhost
port: 8080
tls: true Result: ✓ Valid — 3 keys, max depth 1, 1 top-level key (server)
Input (with error):
database:
host: localhost
port: 5432 Result: ✗ Line 2: Tab characters are not allowed in YAML indentation
FAQ
What does the YAML Validator check? ›
It checks for valid YAML syntax including proper indentation (spaces only, no tabs), valid key-value pairs, duplicate keys within a mapping, and common pitfalls like unquoted values that YAML interprets as booleans (yes, no, on, off). It also warns about trailing whitespace and the "Norway problem" (unquoted country codes that YAML treats as booleans).
Why does YAML treat "yes" and "no" as booleans? ›
YAML 1.1 (the most widely implemented version) interprets unquoted yes, no, on, off, true, and false as boolean values. This is known as the "Norway problem" because the country code NO (without quotes) becomes false in YAML. Always quote string values that could be misinterpreted.
Does it support multi-document YAML (--- separator)? ›
The validator validates the first document in a multi-document YAML stream. Lines after a --- document separator are treated as a separate document and are not validated. For full multi-document support, validate each document separately.
Can I validate YAML from a file? ›
Yes, click the File button to upload a .yaml or .yml file. The validator reads the file and runs validation automatically.
How do I fix invalid YAML after validation? ›
After the validator points out syntax issues, fix your YAML and re-validate. If you then need to convert the corrected YAML to JSON or check the round-trip, use the YAML ↔ JSON converter.