Back
Asciify Logo
Asciify
BSLF

Horizontal Tab

HT (Horizontal Tab) is ASCII code point 9 (0x09), Unicode U+0009, and a control character. If your code looks fine on your machine but misaligned on a colleague's, tab width differences are almost certainly the cause. HT advances the cursor to the next tab stop — traditionally every eighth column — creating aligned columns without manually inserting spaces. The `\t` escape is universal across C, Python, Java, and nearly every other language, but what it produces depends on context. Editor tab width can be 2, 4, or 8 spaces, so the same file renders differently across machines unless the team enforces settings via `.editorconfig`. Python 3 raises a `TabError` if you mix tabs and spaces for indentation. YAML forbids tabs entirely for indentation, usually with an unhelpful error message. The name is short for "tabulator," a typewriter feature from the late 1800s. Metal clips along a rail defined column positions; pressing the key flung the carriage to the next clip, eliminating the need to count spaces by hand. UTF-8 encodes it as a single byte 0x09, identical to its ASCII value. Unicode classifies it as Cc (Control, Other) under the official name CHARACTER TABULATION. Occasionally confused with VT (U+000B), which advances downward rather than across, and unrelated to fixed-width Unicode spaces like em space (U+2003) — tab is an instruction to jump to a position, not a character with an intrinsic width.

Whitespace

Technical Details

Code Example

</>
const char *tsv = "id\tname\tage"; // HT separators
char field_sep = '\t'; // ASCII 9 (0x09)
size_t tabs = 0; for (const char *p = tsv; *p; p++) if (*p == field_sep) tabs++; // count fields

Frequently Asked Questions

  • Both work; consistency matters most. Tabs are more accessible — users can set their preferred visual width. Spaces guarantee identical appearance everywhere. Most modern projects pick one and enforce it via .editorconfig or a formatter. The 'war' is mostly a meme at this point.

  • Tabs allow visually impaired developers to increase indentation width (e.g., to 8 spaces) for better readability without changing the file content. Spaces force a fixed width that might be too narrow for some users to visually scan.

  • A tab character just means 'advance to the next tab stop.' The width of that jump — 2, 4, or 8 columns — depends on the editor/terminal settings. That's why the same file can look perfectly aligned in VS Code but ragged in a GitHub diff.

  • Most linters (ESLint, Pylint) and editor extensions ('Indent Rainbow') can highlight mixed indentation. The command line tool `grep -P '\t ' filename` can find lines where tabs follow spaces or vice-versa. Enabling 'render whitespace' in your editor is the best preventative measure.

  • TSV (Tab-Separated Values) uses tabs instead of commas between fields. It's better when your data contains commas (names, addresses, sentences) because tabs rarely appear in real text. The trade-off: TSV files are harder to edit manually since tabs are invisible.

  • Most editors have a setting for this — VS Code shows it in the status bar. From the command line, 'expand' converts tabs to spaces and 'unexpand' does the reverse. The 'pr -t -e4' command expands to 4-space tab stops. Pick a method and apply it consistently.

@workani&@alexluthor
Privacy & legal

Privacy

No accounts, no ads, no tracking cookies, and no cross-site tracking. The only analytics we keep are faceless — anonymous, aggregated counts of pages and searches, never tied to you. We store no IP addresses, set no tracking cookies, and build no profiles. Cloudflare hosts the site and handles requests for delivery and security.

Full privacy policy·Extension privacy·legal@asciify.dev

Attributions & licenses

Twemoji
© Twitter, Inc and other contributors · CC-BY 4.0
Noto Color Emoji
© Google · Apache 2.0
Fluent UI Emoji
© Microsoft · MIT
OpenMoji
© HfG Schwäbisch Gmünd · CC-BY-SA 4.0
Toss Face
© Viva Republica (Toss) · SIL OFL 1.1
JoyPixels
© JoyPixels Inc. · Free Limited Use License
SerenityOS Emoji
© The SerenityOS Developers · BSD-2-Clause
EmojiTwo
© EmojiTwo contributors · CC-BY 4.0
Apple Color Emoji
© Apple, Inc.
Facebook Emoji
© Meta Platforms, Inc.

Apple and Facebook emoji styles are proprietary and shown here solely for reference and comparison — a common-sense application of nominative-use / fair-use principles. asciify is not affiliated with, endorsed by, or sponsored by Apple, Inc., Meta Platforms, Inc., or any other rights holder listed above. If a rights holder requests removal of their emoji style from this site, it will be removed.

All other vendor emoji are reproduced for reference and comparison under their respective open licenses listed above.

Character names and code points from the Unicode® Standard. Unicode® and the Unicode Logo are registered trademarks of Unicode, Inc.

Privacy
© asciify.dev 2025-2026