YAML Validator
Validate your YAML instantly with detailed error reporting. Get exact line and column numbers for any syntax errors.
Awaiting input
Paste your YAML and start typing to validate.
What Does YAML Validation Check?
A YAML validator parses your input according to the YAML specification and reports any syntax errors it finds. Valid YAML is correctly parsed into a data structure (mappings, sequences, and scalars); invalid YAML causes the parser to abort with an error message that includes the line and column where the problem was detected.
Validation is the first step before deploying any YAML-driven configuration. A single syntax error in a Kubernetes manifest or GitHub Actions workflow file will cause the entire apply or pipeline run to fail - often with a cryptic error that points to the wrong line. Catching the error here, before deployment, saves significant debugging time.
YAML Syntax Rules
- Indentation with spaces only - the YAML 1.2 spec prohibits tab characters for indentation. Each nesting level must be indented by a consistent number of spaces relative to its parent.
- Consistent indent width - child nodes must be indented more than their parent. Mixing 2-space and 4-space indentation within the same document produces parse errors.
- Colon-space for mappings - mapping keys must be followed by
:(colon then space). A colon with no trailing space is interpreted as part of the key name, not a key-value separator. - Dash-space for sequences - sequence items must begin with
-(dash then space) at the correct indent level. - Quoted strings for special characters - strings containing
: # [ ] , & * ! | > ' " % @ `at the start or in a context where they would be misinterpreted must be quoted. - Unique keys per mapping - duplicate keys within the same mapping are technically allowed by the spec but most parsers warn or error. Kubernetes and many other systems reject them.
Common YAML Errors
- Tab indentation - the single most common YAML error. Editors set to insert tabs produce files that look correct visually but are rejected by every strict YAML parser. Use "show invisibles" in your editor to detect tabs.
- Missing space after colon - writing
key:valueinstead ofkey: valuecauses the entire token to be interpreted as a plain scalar string rather than a key-value pair. - Unquoted special values - bare values like
yes,no,on,off, andnullare parsed as booleans or null in YAML 1.1. Wrap them in quotes if you intend them as strings. - Inconsistent list indentation - in a sequence of mappings, the
-marker and the first key of each item must be on the same line or consistently offset. Misaligning them produces a mapping-inside-sequence parse error. - Unescaped backslashes in double-quoted strings - inside double-quoted strings,
\is an escape character. A lone backslash (e.g. a Windows path) must be written as\\or the string switched to single quotes.
YAML 1.1 vs. YAML 1.2
Most YAML tooling in use today implements YAML 1.1 (published 2005), while the current specification is YAML 1.2 (2009). The key behavioural differences affect how certain scalar values are interpreted:
YAML 1.1 Boolean Gotchas
In YAML 1.1, the values yes, no, on, off, true, and false (in any case combination) are all booleans. YAML 1.2 restricts booleans to only true and false.
Octal Literals
YAML 1.1 interprets integers with a leading zero (e.g. 0777) as octal. YAML 1.2 requires the explicit 0o777 prefix. File permission values in Ansible and Docker configs are a frequent source of this mismatch.