# Why hexadecimal instead of base-32 or higher?

**URL:** <https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765>\
**Category:** Factual Questions\
**Created:** [September 28, 2014, 5:32am UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765 "2014-09-28T05:32:22Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [September 28, 2014, 8:28pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/21 "2014-09-28T20:28:04Z")

</div>

> [@sbunny8](#):
>
> The nature of electrical switches naturally leads to base 2 (ones and zeros). These are bits. The bits have no meaning by themselves until they are grouped into bytes.

Didn’t Russia experiment with 4-state bits (a switch has four distinct thresholds 0,1,2,3)? It didn’t work out, obviously, but I thought I read something about that.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [September 28, 2014, 9:00pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/22 "2014-09-28T21:00:12Z")

</div>

> [@Jragon](#):
>
> Didn’t Russia experiment with 4-state bits (a switch has four distinct thresholds 0,1,2,3)? It didn’t work out, obviously, but I thought I read something about that.

Are you thinking of the Russian [Setun computer](http://en.wikipedia.org/wiki/Setun)? It was called _ternary_, but actually used two ordinary two-level signals or latches to represent a trit, with a fourth illegal state playing an error-checking role.

[historical anecdote]Another computer which used two bits to represent a trit in one case was a CII-Honeywell-Bull machine which used base-3 parity-checking on main memory. When they upgraded the design to use ECC, the ternary check-datum had to be maintained: Some programmers had taken advantage that they could squeeze an extra bit into a word in 1/3 of the cases. :rolleyes: [/anecdote]

---

<div class="post-metadata">

**Author:** ![Hail\_Ants](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@Hail\_Ants](https://boards.straightdope.com/u/Hail_Ants)\
**Post date:** [September 28, 2014, 10:57pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/23 "2014-09-28T22:57:30Z")

</div>

I think it also had a lot to do with the cost of memory, which was astronomical all thru the golden age of mainframe computers (and thru the beginnings of home PCs as well). In terms of powers of 2:

8-bit = 2[sup]8[/sup] = **256** = Too small  
32-bit = 2[sup]32[/sup] = **4,294,967,296** = Way, way, _ **way** _ too big!  
16-bit = 2[sup]16[/sup] = \*\*65536 \*\*= Just right

IOW 64K (hexadecimal) was in the Goldilocks zone in terms of usefulness vs. cost. Home PCs followed a similar pattern. The original 8086 was 16-bit, but the later, cheaper (and therefore more popular) 8088 was actually 8-bit. The 80286 was 16. The 80386 had several versions to balance cost & performance (internal 32-bit but external 16). Finally with the 80486 (and all the later models) 32-bit became the standard for nearly two decades. Only fairly recently have we finally moved to 64-bit computing.

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [September 28, 2014, 11:09pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/24 "2014-09-28T23:09:38Z")

</div>

> [@BigT](#):
>
> But octal would suck for handling 8 bits, as 8 is not a multiple of 3. Octal is three bit, after all (8=2[sup]3[/sup], so it takes three bits to encode each digit)
> 
> Hexadecimal, on the other hand, works great for 8 bit, since it’s a 4-bit system.

Eh. Less convenient, but it didn’t suck. You just got used to the fact that a byte would only go up to 377[sub]8[/sub]; a 7-bit ASCII character would only go up to 177[sub]8[/sub]. The advantage of octal was that it was a little easier to remember the bit patterns for 0-7 than for 0-F. Remember, these representations are purely for the convenience of the programmer/user. The computer doesn’t really care.

---

<div class="post-metadata">

**Author:** ![dropzone](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dropzone/32/7515_2.png) [@dropzone](https://boards.straightdope.com/u/dropzone)\
**Post date:** [September 29, 2014, 3:14am UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/25 "2014-09-29T03:14:35Z")

</div>

I have an abacus with five beads in the lower section and two beads in the upper. In base 10 I only use four lower and one upper, but using all the beads it’s base 16, which I understand has been used forever in some transactions in China. I tracked my calls one day in hex, but it was a headache. /aside

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [September 29, 2014, 5:57am UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/26 "2014-09-29T05:57:16Z")

</div>

> [@wolfpup](#):
>
> Before System/360, octal was very common and perhaps almost universal, even in IBM (e.g.- 7040, 7044, 7090, 7094 documentation all used octal notation). It worked well because word length tended to be a multiple of 3: 12, 18, and 36 bit word lengths were very common, and computers typically used word addressing. The System/360 was the first large-scale introduction of byte addressing and word and data path widths that were byte-multiples, so octal would have been awkward and hex was a perfect fit.

Besides the functional advantages of base-16, IBM also wanted to use something different to sell the idea that the 360 was a completely new and different system.

> [@sbunny8](#):
>
> But then there’s the second purpose, instructions. At the machine-code level, you need instructions for the CPU like “add together these two numbers” or “skip over the next five instructions and read the sixth one instead”. And it’s pretty darn clumsy trying to write a complete set of instructions with just 32 choices, or even 64. 128 is much better, and 256 is great.

But this is only true for CISC design computers. The RISC (Reduced Instruction Set Computer) designs being pioneered at that time by Seymour Cray in the early supercomputers (and modern graphics chips) could do fine with fewer instruction codes.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [September 29, 2014, 7:00am UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/27 "2014-09-29T07:00:35Z")

</div>

> [@t-bonham@scc.net](#):
>
> But this is only true for CISC design computers. The RISC (Reduced Instruction Set Computer) designs being pioneered at that time by Seymour Cray in the early supercomputers (and modern graphics chips) could do fine with fewer instruction codes.

And speaking of Seymour Cray –

The entire line of Control Data CDC-6400-6600-7600 mainframes had 60-bit words that were only word-addressable, not byte-addressable. The various register banks came in groups of 8: X0-X7, A0-A7, and B1-B7 (B0 was reserved); so it took 3 bits to specify one particular register in each of these groups. Instruction codes were 6 bits. The address and index registers (Ax and Bx registers) were 18 bits.

So everything about these computers fell neatly into multiples of 3 or 6 bits; so octal was the natural human-readable base for them.

ETA: And the character code used 6-bit characters too, not 8-bit.

---

<div class="post-metadata">

**Author:** ![Malacandra](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Malacandra](https://boards.straightdope.com/u/Malacandra)\
**Post date:** [September 29, 2014, 7:38am UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/28 "2014-09-29T07:38:22Z")

</div>

> [@williambaskerville](#):
>
> It’s also relatively easy to convert between hex and binary.
> 
> Every hex digit is four binary digits :- if you call this a party trick, I have a party trick where I can convert any arbitrary length hex number to binary in my head.
> 
> It’s surprisingly easy :- all you have to remember is the conversions of each hex digit to binary, eg
> 
> 07 -\> 0111  
> 0A -\> 1010  
> 0E -\> 1110
> 
> So deadbeef in binary is :-
> 
> 1101 1110 1010 1101 1011 1110 1110 1111
> 
> (I just typed that, hope it’s right).
> 
> No, this particular party trick doesn’t impress girls.

It’s nearly as easy in base 32 - each digit then converts to 5 bits. Unfortunately you then have to remember 22 different bit patterns above decimal 9, instead of only 6.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [September 29, 2014, 7:51am UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/29 "2014-09-29T07:51:38Z")

</div>

> [@Malacandra](#):
>
> It’s nearly as easy in base 32 - each digit then converts to 5 bits. Unfortunately you then have to remember 22 different bit patterns above decimal 9, instead of only 6.

I would say that is significantly less easy, not nearly as easy. And the alignment problems make the idea of using base-32 moot on anything but super-weird architectures.

---

<div class="post-metadata">

**Author:** ![Learjeff](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@Learjeff](https://boards.straightdope.com/u/Learjeff)\
**Post date:** [September 29, 2014, 2:12pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/30 "2014-09-29T14:12:12Z")

</div>

> [@Sage\_Rat](#):
>
> I think [8 bit bytes] is the main reason. Octal used to be fairly popular, because 12-bit machines used to be common and 3-bit groupings nicely divide into that. If we had ended up with 10-bit bytes, base-32 would probably be prevalent.

Bingo.

> [@septimus](#):
>
> Octal was once much more common than hexadecimal, even on machines with, say, 16-bit words (not a multiple of 3). I wonder if IBM’s S/360, with lots of 4-, 8-, and 12-bit fields, was a major turning point.

As I recall, the only 16-bit machine to use octal was the DEC PDP-16, and that was because machine instructions were organized into 3-bit groups. For example, address mode and address index were both 3-bit fields, and certain address offsets less than a full word were some multiple of 3 bits. It was actually a PITA, though, because you’d often want to see both the octal and the hex (because addresses in the instruction stream that were full 16 bit words were far easier to read in hex.)

> [@friedo](#):
>
> I would say that is significantly less easy, not nearly as easy.

Yeah, I’d hate to work in base 32! It took a while to learn to add and subtract hex in my head. I doubt I’d ever master 10 numerical digits plus 22 letters. Quick: what’s n + v?

So, I’m very glad that we don’t have 10-bit bytes. That would be even worse than the damn nuisance of little-endian byte order.

---

<div class="post-metadata">

**Author:** ![robert\_columbia](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@robert\_columbia](https://boards.straightdope.com/u/robert_columbia)\
**Post date:** [September 29, 2014, 2:34pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/31 "2014-09-29T14:34:14Z")

</div>

> [@friedo](#):
>
> The purpose of hexadecimal notation is to make binary numbers easy to read for humans. 16 is a good number of symbols for three reasons:  
> …  
> 2. Base-16 is also a small enough set of symbols to be comprehensible. A base-32 system would require nearly every letter of the alphabet. How much is 3L8P?..

Good point. If you went much above base 32, you would have to start picking symbols. What are you going to use? Sure, maybe you can start with Greek and Hebrew letters, but then what? Cyrillic? Arabic? Linear B? Aramaic? Viking Runes? Egyptian Hieroglyphs? Squiggles and Smiley Faces? Can anyone really master so many symbols at the same time?

Quick, how much is 24AלֶΣع9كZ3הWΓש plus ΔД4Ψ4QΠՃקЯ? Don’t forget to carry the ⴴ. Can you divide ႥИ3R0Ж by تاΩ2Θג?

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [September 29, 2014, 3:47pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/32 "2014-09-29T15:47:39Z")

</div>

> [@robert\_columbia](#):
>
> … Quick, how much is 24AלֶΣع9كZ3הWΓש plus ΔД4Ψ4QΠՃקЯ? …

I’m not sure, but I do know it contains %$&%^\*!!# at least once in the calculation process. At least it does when I do it 😉

---

<div class="post-metadata">

**Author:** ![robert\_columbia](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@robert\_columbia](https://boards.straightdope.com/u/robert_columbia)\
**Post date:** [September 29, 2014, 4:05pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/33 "2014-09-29T16:05:54Z")

</div>

> [@LSLGuy](#):
>
> I’m not sure, but I do know it contains %$&%^\*!!# at least once in the calculation process. At least it does when I do it 😉

That’s why proposals to go to higher bases rarely earn grades above Ռ. A few years ago, a master’s thesis proposing a base 128 system earned a GPA-equivalent grade of Վ.መᛗ, but that triggered a review of the school’s academic standards and resulted in the District Խ (section ב) Accreditation Agency issuing a Level Щ revocation warning with a ΞևЛ-month probationary period.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [September 29, 2014, 4:09pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/34 "2014-09-29T16:09:25Z")

</div>

> [@Learjeff](#):
>
> As I recall, the only 16-bit machine to use octal was the DEC PDP-16, and that was because machine instructions were organized into 3-bit groups.

The 16-bit Data General Nova was also generally documented with octal, even though its instruction set did _not_ map nicely to the octal digits.

There is a cause-effect relationship which operates the other way. I know of machines with 16-bit or 32-bit control words in which the controls were organized into nibyls and bytes, e.g. 4+4+4+4, even though there was no hardware reason for it, i.e. when a 4+5+2+5 decoding might have been more efficient.

~ ~ ~ ~ ~ ~

On the other topic, I find it very unlikely that base-32 arithmetic with 32 symbols would be as easy to learn as hexadecimal. Note that human counting systems with bases above 10 were always hybrid systems. The Mayan base-20 in effect alternated base 4 and base 5; Babylonian base-60 alternated 6 and 10.

---

<div class="post-metadata">

**Author:** ![Learjeff](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@Learjeff](https://boards.straightdope.com/u/Learjeff)\
**Post date:** [September 29, 2014, 4:18pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/35 "2014-09-29T16:18:32Z")

</div>

> [@septimus](#):
>
> The 16-bit Data General Nova was also generally documented with octal, even though its instruction set did _not_ map nicely to the octal digits.

Oops. I should have remembered that, since I coded DG Nova and Eclipse for a few years. That’s an architecture that did not have direct byte addressability in the hardware.

Mostly what I remember from Nova/Eclipse was that they seemed to have chosen the hard way to do just about everything. Ick.

---

<div class="post-metadata">

**Author:** ![Sage\_Rat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sage_rat/32/399_2.png) [@Sage\_Rat](https://boards.straightdope.com/u/Sage_Rat)\
**Post date:** [September 29, 2014, 5:27pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/36 "2014-09-29T17:27:52Z")

</div>

> [@robert\_columbia](#):
>
> That’s why proposals to go to higher bases rarely earn grades above Ռ. A few years ago, a master’s thesis proposing a base 128 system earned a GPA-equivalent grade of Վ.መᛗ, but that triggered a review of the school’s academic standards and resulted in the District Խ (section ב) Accreditation Agency issuing a Level Щ revocation warning with a ΞևЛ-month probationary period.

Well now you’re just being silly.

---

<div class="post-metadata">

**Author:** ![wolfpup](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolfpup/32/10618_2.png) [@wolfpup](https://boards.straightdope.com/u/wolfpup)\
**Post date:** [September 29, 2014, 7:25pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/37 "2014-09-29T19:25:45Z")

</div>

> [@Senegoid](#):
>
> ETA: And the character code used 6-bit characters too, not 8-bit.

The PDP-10 and its predecessor the PDP-6 used standard 8-bit ASCII, but there was also a subset used for system functions like filenames that used 6-bit character codes, which were denoted in assembly code with the pseudo-op “SIXBIT”. This scheme allowed 6-character filenames to be encoded in a single 36-bit word (and the 3-character extension in exactly half of another one). That, and the preponderance of architectures that were a multiple of 3 bits (like the 12-bit PDP-8) probably explains the legacy of 6-character filenames that were inherited by DOS and then early versions of Windows and persisted until Windows 95. It was also just about the right length to have meaningful names without wasting precious storage resources.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [September 29, 2014, 7:31pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/38 "2014-09-29T19:31:31Z")

</div>

MS-DOS actually had eight-character filenames (plus a three-char extension.)

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [September 29, 2014, 8:15pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/39 "2014-09-29T20:15:26Z")

</div>

Oh, and recently I was working on something where quaternary really would have been handy. There’s a function called SHUFPS on some processors. One register can hold 128-bits worth of stuff, and there are functions that allow you to use all 128-bits at once for 4 32-bit floating point numbers.

The SHUFPS instruction, when used on a single register, allows you to “shuffle” the four numbers, so if I have the vector

[1, 2, 3, 4] you can shuffle it to [4, 2, 1, 3] or even duplicate like [4, 4, 4, 3].

SHUFPS accomplishes this with a single 8-bit number, with each two bits specifying which index the new number will be from. So to go from [1,2,3,4] to [4,3,2,1] you would have [11][10][01][00] or 3 2 1 0 (since we start counting with the first element at zero). The assembler I was using supports decimal, octal, or hex literals, so I had to convert this to 0xE4. It’s admittedly not onerous at all since I’m used to hex, but I really would have preferred to be able to just pass 4b\_3210 or 4b\_3332.

---

<div class="post-metadata">

**Author:** ![wolfpup](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolfpup/32/10618_2.png) [@wolfpup](https://boards.straightdope.com/u/wolfpup)\
**Post date:** [September 29, 2014, 8:26pm UTC](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765/40 "2014-09-29T20:26:37Z")

</div>

> [@friedo](#):
>
> MS-DOS actually had eight-character filenames (plus a three-char extension.)

D’oh! :o I should limit myself to discussions of ancient history like the PDP-8, PDP-11, and PDP-10! I was confused by the recollection that the OS/8 system on the PDP-8 was modeled on the PDP-10 and had the same 6+3 filename structure (even though 8+3 would have been just as easy since it could only store 2 characters per word anyway). Thanks for fighting ignorance – or, in this case, a defective memory!

[Previous page](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765.md?page=1)

[Next page](https://boards.straightdope.com/t/why-hexadecimal-instead-of-base-32-or-higher/699765.md?page=3)
