YAML Validation: Common Errors and the Norway Problem
Find YAML syntax errors by line and column, catch duplicate keys and tabs, and avoid YAML 1.1 traps such as yes, no, octal numbers and version 1.10.

YAML Validation: Common Errors and the Norway Problem
YAML is everywhere in modern infrastructure: Kubernetes manifests, GitHub Actions and GitLab CI pipelines, Docker Compose, Ansible playbooks and countless application configs. It is pleasant to read and easy to break. A single wrong indent changes the structure without any error, and some plain words change meaning depending on the parser. The free YAML Validator and Linter reports real syntax errors with their line and column, and warns about the quieter mistakes that pass validation but produce the wrong data.
Syntax errors
These stop a parser outright:
- Tabs for indentation. YAML forbids tab characters in indentation. Editors that insert tabs cause errors that look invisible on screen.
- Inconsistent indentation inside a mapping or list, such as one key indented three spaces and its sibling two.
- A colon without a space, or a value that starts with a special character such as
@, a backtick or%without quotes. - Unclosed quotes and brackets in flow-style lists and maps.
The validator shows the first error with its position and a short excerpt of the line, so you can jump straight to it.
Duplicate keys
Many parsers accept a mapping that repeats a key and silently keep only the last value. In a long Kubernetes manifest with two env sections, half your environment variables can disappear without any message. The validator treats a repeated key as an error and points to the line where it repeats, so the second value cannot hide the first.
The Norway problem and other YAML 1.1 traps
The YAML 1.1 specification treated many plain words as booleans: yes, no, on, off, y and n in various cases. A list of country codes that includes NO for Norway became false. YAML 1.2, published in 2009, fixed this, but plenty of widely used parsers and tools still follow 1.1 rules.
Numbers have similar traps:
010is octal 8 in YAML 1.1 but decimal 10 in many other contexts.1.10is a float equal to1.1, so a version number loses its last digit.12:30can be read as a base-60 number, 750, by 1.1 parsers.
The linter warns about each of these and suggests quoting. Quoting values that must stay text, such as versions, country codes, postcodes and times, is the safest habit.
Trailing spaces and line endings
Trailing spaces are harmless for most values but cause noisy diffs and occasional surprises inside block scalars. The linter lists each line that has them, so you can clean them up before committing.
Anchors, aliases and merges
YAML can define a block once with an anchor such as &defaults and reuse it with *defaults, or merge it into a mapping with the merge key. This keeps CI files short but makes it hard to see the final values. Turn on the JSON view to see the fully expanded data exactly as a program will receive it.
What validation cannot check
The validator confirms that the text is well-formed YAML and highlights risky values. It does not know the schema of a particular tool. A Kubernetes manifest can be perfect YAML and still use a field name the API rejects. After validating, check the document with the tool's own validator, such as a dry run or a schema-aware editor extension.
Step by step
- Paste the YAML or open the file.
- Fix any syntax error shown with its line and column.
- Review duplicate key and YAML 1.1 warnings, and quote values that must stay text.
- Turn on the JSON view to confirm the structure.
- Copy the cleaned YAML back into your project.
Privacy
Validation runs in your browser. Configuration files with hostnames, secrets or internal addresses never leave your device.



