YAML Uses Spaces to Show Structure
YAML represents nested data through indentation: a more-indented line belongs beneath the item above it. For example, a settings file might place a database name under a `database` key, with indentation marking that relationship. YAML requires spaces—not tab characters—to create this structural indentation.
A tab may look like a few spaces in an editor, but its displayed width can vary. More importantly, YAML parsers do not treat a tab as a valid substitute for spaces at the start of an indented line. When one appears there, the parser may reject the file instead of guessing how the data is nested.
Find and Replace the Hidden Character
The problem can be hard to spot because tabs are often invisible. If a YAML file suddenly fails to load after editing, check the beginning of the affected lines and use the editor’s option to show whitespace. Replace indentation tabs with spaces, then keep the spacing consistent throughout the nested section.
This rule applies to indentation, not every tab anywhere in a file: tabs can be part of quoted text or other scalar content. The practical distinction is whether the character is being used to arrange YAML’s structure. A file can contain meaningful tab text, but its hierarchy must be built with spaces.






