Free Online YAML Validator
The YAML Validator checks your YAML for the errors that break most files: inconsistent indentation, tabs, duplicate keys, and malformed key/value lines. It reports the line number of each problem.
The neighbouring validators are the JSON Validator, and the conversion between the two formats is handled by the YAML to JSON Converter and JSON to YAML Converter. For the tabular form, the YAML to CSV Converter is the next step.
How to use the YAML Validator
- 1 Paste your YAML or load a file.
- 2 Validate. Any error is reported with its line and the construct that failed.
- 3 Fix the reported line and validate again.
- 4 Check the parsed structure view to confirm the file means what you intended.
Why validation matters more for YAML
YAML's readability is bought with fragility. Because indentation is structural and quoting is usually optional, small changes can have large effects, and a file can parse successfully while meaning something entirely different from what it appears to say.
The specific danger is at the boundaries: a value that looks like a string but parses as a number or a boolean, a colon that turns a scalar into a mapping, or an indentation level that nests something under the wrong parent. Validating before use is cheap and catches all of them.
- Tabs in indentation are forbidden.
- Unquoted colons begin a nested mapping.
- Duplicate keys may be silently discarded by lenient parsers.
- Validate after every hand edit, not just at deployment.
Common YAML mistakes
YAML forbids tabs for indentation, requires consistent spacing for sibling keys, and treats a space after the colon as significant. This validator catches those cases before they reach your CI pipeline.
Frequently asked questions
Why is a tab an error rather than a warning?
Because the YAML specification does not permit tabs for indentation. A tab is a distinct character from a space, and a parser cannot reliably infer how many columns it occupies, so allowing it would make the file's meaning depend on a rendering convention. Its presence anywhere in the indentation is a hard error.
How do I fix "mapping values are not allowed in this context"?
Almost always an unquoted colon. A value such as a URL or a phrase containing a colon is parsed as the start of a nested mapping. Quoting the whole value, or using a block style, resolves it. This is the most common YAML error and it appears in configuration files containing anything resembling an address or a timestamp.
What does a duplicate key do?
It is an error in a strict validator, though some parsers silently take the last value. That divergence is dangerous precisely because it is silent — a file can appear to work while a whole configuration block is being discarded. A validator that reports duplicates is catching a real defect.
Related Developer Tools
You might also need
Tools from other categories that people pair with the YAML Validator: