1. In an Internet browser, a tab refers to an open web page in tabbed browsing. See our tabbed browsing definition for a full explanation, examples, and pictures for this term.

Tip: To open a new tab in most Internet browsers, press Ctrl + T on your keyboard.

Tip: To close a single tab at a time in most Internet browsers, press Ctrl + W on your keyboard.

Tab arrow mark2.A tab is an indentation at the beginning of a line of text to signify a new paragraph in a document or to help create equal spacing between multiple lines. When formatting marks are visible, tabs are represented by an arrow, as shown in the example picture to the right.

How many spaces are in a tab?

The equivalent number of spaces used to create a tab is usually five or eight spaces depending on the program being used and sometimes in the case of a word processor the font being used. However, keep in mind that a tab can be set to any value which means a tab could also be two, three, four, six, or seven spaces.

Note: A tab is only one character. In other words, when you press the tab key it is not creating several spaces in a row.

Should I use tabs or spaces for indenting?

Generally speaking, we recommend using the Tab key to create spaces because it is quicker, less prone for errors, and makes the files smaller.

In computer programming or when creating a code block in a program both tabs and spaces are valid for indentation. Some programmers swear by tabs and others swear by spaces. Our best advice is to follow the standard set by either the original programmer or by the company creating the program. If you are accustomed to spaces or tabs, you can also convert one into the other in many programs. Just make sure that you convert it back to the original standard after you have completed making your changes.

Tab in a regular expression

With many programming languages and when working with a regular expression, a tab is matched by using the "\t" meta-character or escape sequence. For example, with the Perl code below if the $example variable contains any tab, the script would print "I found a tab!" when ran. You can also use "\s" to find any whitespace, which means tabs or spaces would be found.

if ($example =~ /\t/) { print "I found a tab!"; }
if ($example =~ /\s/) { print "I found white space!"; }

Related pages

3. In a software program window and an Internet browser, a tab allows for the user to access different parts of a menu, program window, or web page. Below is an example of what tabs may look like in a Microsoft Windows setting.


Tip: Use the keyboard shortcut Ctrl + Tab to switch left-to-right between open tabs in a document or web browser. To move back or right-to-left use the keyboard shortcut Ctrl + Shift + Tab.

Tab keyboard key4.The Tab is a key (shown right) located on the far left side of nearly all computer keyboards that has many uses. For example, in a word processor, they tab key may be used to insert a tab character or advance the typing cursor to the right by five characters. This key can also move between selectable items in a dialog box or switch between tabs in an Internet browser.

Where is the tab key on the keyboard?

Below is an overview of a computer keyboard with the tab key highlighted in blue.

Tab key

Why is there a forward and backward arrow on Tab?

The tab key is capable of moving forwards and backwards, although most people only use it to go forwards, which explains the right arrow. The left arrow is on the key because if you press Shift key and Tab at the same time, the tab is moved backwards.

For example, you can press Alt + Tab to switch between open windows in Microsoft Windows and other operating systems and pressing Alt + Shift + Tab moves backwards. The same is true with open tabs as mentioned earlier on this page. As far as word processors and other programs dealing with text, pressing Shift + Tab decreases the indent in most programs. With early versions of Microsoft Word, you may have to press Ctrl + Shift + M.

Related pages

5. A tab is a plastic piece used to enable/disable write protection on floppy diskette drives.

6. When referring to a command, tabs is a Linux command that sets tabs in the terminal. See the tabs command for further information.

7. A tab is sometimes used as an abbreviation of a tablet.

Also see: Floppy drive definitions, Indent, Keyboard, Keyboard terms, Operating system terms, Tab stop, White space