YAML Validator
This YAML validator finds syntax errors — indentation, tabs, duplicate keys — with the exact line.
YAML input
Validation result
Invalid YAML
Error on line 13, column 8: All sequence items must start at the same column. Check that items at the same level use the same number of spaces.
Error on line 14, column 1: Sequence item without - indicator. A closing quote or bracket is probably missing.
How to validate YAML
- Paste YAML on the left, or open or drop a .yaml or .yml file.
- The result appears as you type: Valid YAML, or the error with its line and column, highlighted in the editor.
- Review warnings about values that different YAML parsers read differently.
Catch YAML mistakes before your pipeline does
A single space too many can turn a list item into something else entirely, and CI systems often report it as a vague parse failure. The YAML validator uses a full YAML 1.2 parser to pinpoint the problem: bad indentation, tab characters, missing colons, unclosed quotes or brackets, and duplicate keys.
steps:
- run: npm ci
- run: npm testIt also warns about yes, no, on and off, which YAML 1.1 tools read as booleans but YAML 1.2 treats as strings — a classic source of “works on my machine” bugs.
Use cases
- Check GitHub Actions and GitLab CI workflows before pushing.
- Validate Kubernetes manifests, Helm values and Docker Compose files.
- Debug Ansible playbooks, OpenAPI specs and app configuration.
Understanding YAML error messages
YAML errors are often reported one line after the real mistake. Two examples:
server:
port: 8080
host: x
→ Line 2, column 9: Nested mappings are not allowed in compact mappings.The extra space before host makes YAML read port: 8080 host: x as one value. Align the keys under the same column to fix it.
a: 1
a: 2
→ Line 2, column 1: Map keys must be unique.Many parsers silently keep the last value; the validator reports it, because a duplicated key in a CI pipeline or Kubernetes manifest is almost always a mistake.
Other YAML tools
Once it's valid, tidy the file with the YAML formatter or convert it with YAML to JSON. For other formats, use the JSON validator or the XML validator.
Frequently asked questions
- What errors does the YAML validator find?
- Syntax errors such as wrong indentation, tabs used for indentation, missing colons, unclosed quotes or brackets, and duplicate keys in the same mapping — each with the line and column.
- Why does it warn about yes and no?
- In YAML 1.1 (used by PyYAML and older tools) yes, no, on and off are booleans. In YAML 1.2 they are plain strings. The validator warns so you can write true/false or quote the value and get the same result everywhere.
- Can I validate Kubernetes, Docker Compose or GitHub Actions files?
- Yes, for YAML syntax. The validator doesn't check the specific schema of those tools (for example required Kubernetes fields), but it catches the syntax errors that make them fail to load.
- Why aren't tabs allowed?
- The YAML specification forbids tabs for indentation because their width is ambiguous. Use spaces.