Quick answer
YAML uses indentation to define structure.
YAML Invalid Indentation
YAML uses indentation to define structure. Each level must use the same character (spaces or tabs) and be aligned correctly. Wrong or inconsistent indentation causes parse errors.
Common causes
- Mixing tabs and spaces for indentation.
- Using fewer or more spaces than the parent level (e.g. child not aligned under key).
- Copy-pasting and losing or changing indentation.
How to fix
- Use only spaces (recommended) or only tabs for indentation; do not mix.
- Keep each nesting level consistent (e.g. 2 spaces per level).
- Validate with an online YAML validator to get the exact line and column.
Examples
Bad
name: app version: 1
Good
name: app version: 1
FAQ
- Can YAML use tabs for indentation?
- Many parsers allow tabs, but the YAML spec recommends spaces. Mixing tabs and spaces is invalid.
- How many spaces for YAML indent?
- Common choices are 2 or 4 spaces per level; consistency matters more than the number.
Fix it now
Try in validator (prefill this example)