Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What where the historical forces at work, the tradeoffs to make, in deciding to use groups of eight bits as the fundamental unit ?

There were machines, once upon a time, using other word sizes, but today for non-eight-bitness you must look to museum pieces, specialized chips for embedded applications, and DSPs. How did the byte evolve out of the chaos and creativity of the early days of computer design?

I can imagine that fewer bits would be ineffective for handling enough data to make computing feasible, while too many would have lead to expensive hardware. Were other influences in play? Why did these forces balance out to eight bits?

(BTW, if I could time travel, I'd go back to when the "byte" was declared to be 8 bits, and convince everyone to make it 12 bits, bribing them with some early 21st Century trinkets.)

share|improve this question
This might be one of those questions where we can't answer it better than good old Wikipedia. – Scott Whitlock Nov 16 '11 at 19:53
So why would you prefer 12 bits to 8? – FrustratedWithFormsDesigner Nov 16 '11 at 19:59
Is the last sentence in jest? A 12-bit byte would be inconvenient because it's not a power of 2. – robjb Nov 16 '11 at 20:00
Memory and registers weren't so cheap back then, so 8 bits was a good compromise, compared to 6 or 9 (fractions of a 36-bit word). Also, address calculations are a heck of a lot simpler with powers of 2, and that counts when you're making logic out of raw transistors in little cans. – Mike Dunlavey Nov 16 '11 at 20:05
Using word sizes that were powers of 2 were not so important in the "early days". The DEC-10 had a 36 bit word, and the CDC 6000 series had 60 bit words, and index registers with 18 bits. – Jay Elston Nov 17 '11 at 18:53
up vote 45 down vote accepted

A lot of really early work was done with 5-bit baudot codes, but those quickly became quite limiting (only 32 possible characters, so basically only upper-case letters, and a few punctuation marks, but not enough "space" for digits).

From there, quite a few machines went to 6-bit characters. This was still pretty inadequate though -- if you wanted upper- and lower-case (English) letters and digits, that left only two more characters for punctuation, so most still had only one case of letters in a character set.

ASCII defined a 7-bit character set. That was "good enough" for a lot of uses for a long time, and has formed the basis of most newer character sets as well (ISO 646, ISO 8859, Unicode, ISO 10646, etc.)

Binary computers motivate designers to making sizes powers of two. Since the "standard" character set required 7 bits anyway, it wasn't much of a stretch to add one more bit to get a power of 2 (and by then, storage was becoming enough cheaper that "wasting" a bit for most characters was more acceptable as well).

Since then, character sets have moved to 16 and 32 bits, but most mainstream computers are largely based on the original IBM PC (a design that'll be 30 years old within the next few months). Then again, enough of the market is sufficiently satisfied with 8-bit characters that even if the PC hadn't come to its current level of dominance, I'm not sure everybody would do everything with larger characters anyway.

I should also add that the market has changed quite a bit. In the current market, the character size is defined less by the hardware than the software. Windows, Java, etc., moved to 16-bit characters long ago.

Now, the hindrance in supporting 16- or 32-bit characters is only minimally from the difficulties inherent in 16- or 32-bit characters themselves, and largely from the difficulty of supporting i18n in general. In ASCII (for example) detecting whether a letter is upper or lower case, or converting between the two, is incredibly trivial. In full Unicode/ISO 10646, it's basically indescribably complex (to the point that the standards don't even try -- they give tables, not descriptions). Then you add in the fact that for some languages/character sets, even the basic idea of upper/lower case doesn't apply. Then you add in the fact that even displaying characters in some of those is much more complex still.

That's all sufficiently complex that the vast majority of software doesn't even try. The situation is slowly improving, but slowly is the operative word.

share|improve this answer
I thought I read somwehere 8 came from the 7bit ASCII plus a validation bit that was needed because the nearly transmission protocols were not as loss-less as the designers wanted :-). – Loki Astari Nov 16 '11 at 22:42
@LokiAstari, Yes, it's called a parity bit, and can be used for crude forms of error detection or recovery. Wikipedia: Parity bit – Michael Kjörling Nov 17 '11 at 12:53
Not sure what the IBM PC has to do with this. "8 bit per byte" was already standard in the CP/M era (<1980), which started on the 8080 CPU (a predecessor of the 8086/8 of the IBM PC era) – MSalters Nov 17 '11 at 15:11
@MSalters: Primarily that it has (arguably) "stunted" the evolution of hardware. No, 8-bits/byte wasn't new with the PC, but until then, most architectures were replaced every few years. The PC has largely stopped that, and taken an architecture that wasn't even particularly progressive when it was new, and preserved it for decades. – Jerry Coffin Nov 17 '11 at 15:16
@LokiAstari: yes, parity was often stored in the "last" bit, but I think that was mostly just making use of it because it was there. Many of the even older 6-bit machines working with even less dependable storage/transmission still did perfectly well without that parity bit for each byte. – Jerry Coffin Nov 17 '11 at 15:19

Seven bits for ASCII information, and one for error-detecting parity.

share|improve this answer
7bits for ASCII and one extra bit that has been used for all sorts of things – Martin Beckett Nov 17 '11 at 6:58
Parity was very important when dealing with early memory. Even after moving to 8 bit data bytes, there were memory chips with 9 bits to allow for parity checking. – Jim C Nov 17 '11 at 13:13
This is an interesting assertion. Is there any historical data to support the idea? – david Jan 17 '13 at 8:28

Take a look at Wikipedia page on 8-bit architecture. Although character sets could have been 5-, 6-, then 7-bit, underlying CPU/memory bus architecture always used powers of 2. Very first Microprocessor (around 1970s) had 4-bit bus, which means one instruction could move 4-bits of data between external memory and the CPU.

Then with release of 8080 processor, 8-bit architecture became popular and that's what gave the beginnings of x86 assembly instruction set which is used even to these days. If I had to guess, byte came from these early processors where mainstream public began accepting and playing with PCs and 8-bits was considered the standard size of a single unit of data.

Since then bus size has been doubling but it always remained a power of 2 (i.e. 16-, 32- and now 64-bits) Actually, I'm sure the internals of today's bus are much more complicated then simply 64 parallel wires, but current mainstream CPU architecture is 64-bits.

I would assume that by always doubling (instead of growing 50%) it was easier to make new hardware that coexists with existing applications and other legacy components. So for example when they went from 8-bits to 16, each instruction could now move 2 bytes instead of 1, so you save yourself one clock cycle but then end result is the same. However, if you went from 8 to 12-bit architecture, you'd end breaking up original data into halfs and managing that could become annoying. These are just guesses, I'm not really a hardware expert.

share|improve this answer
"Very first CPU (around 1970s) ...". You need to do some reading on the history of computing!! The very first CPU for a von Neumann architecture computer was built during World War II ... or before (depending on whose version of history you believe.) – Stephen C Nov 17 '11 at 3:20
and there were computing devices in 19th century and I'm sure egyptians had some kind of calculator pot. That info came from the Wikipedia page that I linked. Like I said, I'm not a hardware expert and I'm certainly not a historian, but if you feel that I'm so far off, you might want to go update that wikipedia page. – DXM Nov 17 '11 at 4:02
I guess it would help if I didn't screw up the link as I was entering in. I also I apologize for saying "first CPU". Since I was quoting the wiki page, I should have said "first microprocessor". That's what I meant. Sorry about that. – DXM Nov 17 '11 at 4:05
A solution to the "pre-electron" computer is to say modern computer or I suppose the electron computer. Even today you could build a mechanical computer. It wasn't until we started to use electron fields to our advantage did we build a micro-processor. – Ramhound Nov 17 '11 at 13:37
The 8-bit byte and 16-bit word size used by the PDP series may have also played a factor in the popularity of 8-bit bytes. – Jay Elston Nov 17 '11 at 18:56

A byte has been variously (at least) 1, 6, 7, 8, 9, 12, 18, 20 and possibly 36 bits, depending on what computer you are looking at. I am taking "byte" here to mean "smallest addressable unit of memory", rather than using any sort of text-centric interpretation.

The 20-bit bytes were extremely common in the "IAS machines", in the 50s. 6, 12, 18 (and maybe 36) were quite popular in a variety of architectures in the 60s, 70s and to some degree 80s.

In the end, having a nice correspondence between "powers of 2" and "bits in an addressable unit" seem to have won out.

share|improve this answer
And never 10 bits? All I could find with Google is some recent video processors are 10 bits. – khrf9 Jan 2 '14 at 0:07
@khrf It's possible, I just can't recall any architecture that had it (I mostly considered general-purpose computers). – Vatine Jan 2 '14 at 12:08
Yes, I consider general-purpose computers too. It's strange because I imagine how nice it would be with 10-bits-byte to know that you can address 1 kilobyte with 1 byte, 1 megabyte with 2 bytes, etc. Of course, it's just a caprice on comfort :) – khrf9 Jan 6 '14 at 15:03

A byte doesn't have to be 8 bits, but it appears that C and C++ define a byte as being at least 8 bits (although it could be more). This question on Stack Overflow mentions a few systems where 1 byte is not 8 bits.

share|improve this answer
C++, or the compiler? – Babiker Dec 26 '14 at 5:16
@Babiker: C++. The compiler will have a precise definition. (CHAR_BITS macro) – MSalters Jan 30 '15 at 13:03

According to my information the word byte itself was derived from the phrase by-eight which was eight (8) bits words. the convenience we find in 8 bits words is the conversion to hexadecimal values since the value 00000000 = 00 & 11111111 = FF (Dec 255 for unsigned and -127 for signed) it is easy to do all arithmetic operations on such structure including bit-wise operations.

I see bytes (8 bits words) as a natural evolution of word sizes from catastrophically small 3 bits up to ridiculously big 60 bits words

share|improve this answer

protected by gnat Jan 30 '15 at 10:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.