Space (20) and Tab (09) in Hexadecimal
Learn the hex values for space (0x20) and tab (0x09) characters. Debug whitespace issues in code, configuration files, and data parsing with hex analysis.
Hex
20 09
ASCII
SP, HT (whitespace)
Detailed Explanation
The two most common whitespace characters — space and horizontal tab — have hex values 20 and 09 respectively. While invisible in most text editors, these characters are clearly distinct in a hex editor, making hex analysis the definitive way to debug whitespace problems in source code, configuration files, and data formats.
Space — hex 20 (decimal 32):
The space character (ASCII 32, hex 20) is the first printable ASCII character and the standard word separator. In hex dumps, it appears in the hex column as 20 and in the ASCII column as an actual space. Some hex editors render it as a mid-dot (·) to make spaces visible.
Tab — hex 09 (decimal 9):
The horizontal tab character (ASCII 9, hex 09) is a control character that causes the cursor to advance to the next tab stop. In hex dumps, it shows as 09 in the hex column and typically as .. or nothing in the ASCII column, since it is a non-printable character (below ASCII 32).
The tabs-vs-spaces debate in hex:
When the eternal "tabs vs. spaces" question causes real bugs, a hex editor provides irrefutable evidence. Indentation with spaces shows as repeated 20 bytes:
20 20 20 20 69 66 20 28 " if ("
Indentation with tabs shows as 09 bytes:
09 69 66 20 28 ".if ("
Mixed indentation (the worst scenario) shows both patterns in the same file, sometimes on adjacent lines.
Common whitespace debugging scenarios:
- YAML indentation errors — YAML requires spaces, not tabs. If a YAML file fails to parse, check in hex for
09bytes in the indentation - Makefile target recipes — Make requires tabs (
09), not spaces (20), before recipe commands. A space-indented Makefile line will produce the error "missing separator" - Trailing whitespace — Some linters and Git hooks flag trailing whitespace. In hex, look for
20or09bytes immediately before0A(LF) or0D 0A(CRLF) - Non-breaking space — Sometimes a non-breaking space (
C2 A0in UTF-8, which is Unicode U+00A0) sneaks into code, looking identical to a regular space but causing parser failures
Other whitespace characters:
Beyond space and tab, several other whitespace characters exist: vertical tab (0B), form feed (0C), carriage return (0D), and various Unicode whitespace characters. In UTF-8, the em-space (U+2003) is E2 80 83, the thin space (U+2009) is E2 80 89, and the zero-width space (U+200B) is E2 80 8B. These exotic spaces occasionally cause mysterious bugs when text is pasted from web pages or word processors.
Use Case
Hex-level whitespace analysis is the go-to method for debugging Makefile tab requirements, YAML indentation failures, invisible non-breaking space bugs, and trailing whitespace issues flagged by linters.