Why is the default tab size 8 spaces? Where does this come from and why is it that big?

18,493

From the Wikipedia article on "Tab key":

In practice, settable tab stops were rather quickly replaced with fixed tab stops, de facto standardized at every multiple of 8 characters horizontally, and every 6 lines vertically (typically one inch vertically). A printing program could easily send the necessary spaces or line feeds to move to any position wanted on a form, and this was far more reliable than the modal and non-standard methods of setting tab stops. Tab characters simply became a form of data compression.

It is unclear why the 8-character horizontal tab size was chosen, since 5 characters, a half inch in a typical printer at that time, was much more popular as a paragraph indentation.

Share:
18,493
nelaaro
Author by

nelaaro

Linux admin, tech enthusiast. opensource evangelist.

Updated on September 18, 2022

Comments

  • nelaaro
    nelaaro over 1 year

    When I push tab in many applications like vim, OpenOffice etc., the tab size is equivalent to 8 spaces/characters.

    This is the default for many applications. When the default terminal size is 80 chars horizontally, why is the tab size this big? After 5 tabs I am half way across the terminal, and text starts to look ugly, with text wrapping.

    I was wondering what the history behind the decision for 8 chars tabs is.

    I know how to change the settings in vim to make it 4 chars. I just want to understand why we still have 8 set as the default across so many applications.

  • nelaaro
    nelaaro over 12 years
    Did not think it has some thing to do with an inch at all.
  • nelaaro
    nelaaro over 12 years
    Why do we still keep that default.
  • Keith Thompson
    Keith Thompson over 12 years
    @nelaar: Historical precedent; there are a lot of text files written to depend on 8-column tabstops. But I (and a lot of other people) prefer spaces rather than tabs for indentation. In my .vimrc, I have set expandtab and set sw=4; I keep tapstops (ts) set to the default 8. I use Ctl-T and Ctrl-D for indentation.
  • Floris
    Floris almost 7 years
    Actually, I believe this comes from the days of manual typewriters - where a fixed tab stop every 8 characters allowed you to quickly format a table of numbers. 8 spaces allowed up to 7 characters plus a space; for most purposes that was (and is) sufficient. Any smaller and you can't fit your numbers; bigger, and you can't have very many columns in your table. I still have a manual typewriter that has fixed tab stops at every 8 characters.
  • GDP2
    GDP2 almost 7 years
    Fyi, Wikipedia has modified that last paragraph to explain why 8 characters was chosen over 5 characters: "A common horizontal tab size of eight characters evolved, despite five characters being half an inch and the typical paragraph indentation of the time, because as a power of two it was easier to calculate in binary for the limited digital electronics available."