This article is about the use of the term Tab in computing. For other uses, see Tab (disambiguation).
A tab character is a form of ASCII control character, used for text alignment. The most known and common tab is a horizontal tab (HT), which in ASCII has the decimal character code of 9. There is also a vertical tab (VT) which in ASCII has decimal character code 11. The horizontal tab is usually generated by the tab key on a standard keyboard. The horizontal tab was originally intended as a mild form of data compression; file sizes could be reduced by using a single horizontal tab character in place of up to eight space characters.
Tabs are almost always rendered as a form of whitespace larger than a single space, while some text editors mark tabs with special graphics to facilitate distinguishing tabs and whitespaces. In word processor applications, the tab key typically moves the cursor to the next tab stop. In most other graphical applications, the tab key will shift the focus to the next control or widget.
A UNIX program, expand expands a tab to a number of spaces and unexpand does the opposite.
In computer programming, the use of tabs for code formatting and indentation is an ongoing debate. Programmers are generally divided into two camps - those who use hard tabs in their code, and those who configure their editors to insert actual space characters when they press the tab key. When tabs are replaced to spaces in this way they are referred to as soft tabs.
There are many arguments for and against using hard tabs in code. What can be said without doubt is that the original purpose of tabs, i.e. compression (see above), is now irrelevant as storage is so cheap.