31 chars · 3 lines
Waiting for input
31 chars · 3 lines
Waiting for input
YAML whitespace troubleshooting
The validator above starts with a mapping whose child keys are indented by tab characters. Replace leading tabs with spaces before debugging application-specific settings because YAML block indentation is defined with spaces. This tool is free to use. No account or payment is required.
Last updated
Editors often display a tab as several columns, so a tab-indented YAML file may look identical to one indented with spaces. Copying from terminals, documentation, or mixed editor settings can introduce them accidentally.
The problem is structural indentation. A tab that is intentionally part of a quoted string is data, so use an editor command that targets indentation rather than globally rewriting every tab character in the file.
The invalid version uses tab characters before name and port; the corrected block uses two spaces.
service:
name: api
port: 8080service:
name: api
port: 8080Common questions
Tabs are not allowed for block indentation. They can appear in some scalar content, so avoid indiscriminate replacement inside data values.
Editors expand tabs visually, but the YAML parser sees a tab character rather than the spaces required for block indentation.
Either can be readable when used consistently. Two spaces is common, but consistency and correct nesting matter more than a specific width.
Debugging a specific YAML issue? Browse YAML troubleshooting.