Base systems like binary and hexadecimal seem a bit strange at first. The key is understanding how different systems “tick over” like an odometer when they are full. Base 10, our decimal system, “ticks over” when it gets 10 items, creating a new digit. We wait 60 seconds before “ticking over” to a new minute. Hex and binary are similar, but tick over every 16 and 2 items, respectively.

Try converting numbers to hex and binary here:

## Way back when: Unary Numbers

Way back in the day, we didn’t have base systems! It was uphill both ways, through the snow and blazing heat. When you wanted to count one, you’d write:

l

When you wanted 5, you’d write

lllll

And clearly, 1 + 5 = 6

l + lllll = llllll

This is the simplest way of counting.

## Enter the Romans

In Roman numerals, two was one, twice. Three was one, thrice:

```
one = I
two = II
three = III
```

However, they decided they could do better than the old tradition of lines in the sand. For five, we could use V to represent lllll and get something like

l + V = Vl

Not bad, eh? And of course, there are many more symbols (L, C, M, etc.) you can use.

The key point is that V and lllll are two ways of encoding the number 5.

## Give each number a name

Another breakthrough was realizing that **each number** can be its own distinct concept. Rather than represent three as a series of ones, give it its own symbol: “3″. Do this from one to nine, and you get the symbols:

1 2 3 4 5 6 7 8 9

The Romans were close, so close, but only gave unique symbols to 5, 10, 50, 100, 1000, etc.

## Use your position

Now clearly, you can’t give **every** number its own symbol. There’s simply too many

But notice one insight about Roman numerals: they use **position** of symbols to indicate meaning.

IV means “subtract 1 from 5″

and VI means “add 1 to 5″.

In our number system, we use position in a similar way. We **always add** and never subtract. And each position is 10 more than the one before it.

So, 35 means “add `3*10`

to `5*1`

″ and 456 means `4*100 + 5*10 + 6*1`

.

## Our choice of base 10

Why did we choose to multiply by 10 each time? Most likely because we have 10 fingers.

One point to realize is you need enough digits to “fill up” until you hit the next number. Let me demonstrate.

If we want to roll the odometer over every 10, so to speak, we need symbols for numbers one through nine; we haven’t reached ten yet. Imagine numbers as ticking slowly upward – at what point do you flip over the next unit and start from nothing?

## Enter zero

And what happens when we reach ten? How do we show we want exactly one “ten” and nothing in the “ones” column?

We use zero, the number that doesn’t exist. Zero is quite a concept, it’s a placeholder, a blank, a space, and a whole lot more. Suffice it to say, Zero is one of the great inventions of all time.

Zero allows us to have an empty placeholder, something the Romans didn’t have. Look how unwieldly their numbers are without it.

George Orwell’s famous novel “1984″ would be “MCMLXXXIV”! Rolls right off the tongue, doesn’t it?

## Considering other bases

Remember that we **chose** to roll over our odometer every ten. Our counting looks like this:

1 2 3 4 5 6 7 8 9 (uh oh, I’m getting full!) 10 (ticked over – start a new digit)

What if we ticked over at 60 when we counted, like we do for seconds and minutes?

1 second 2 3 4 5 … 58 59 1:00 (60 seconds aka 1 minute. We’ve started a new digit.)

Everything OK so far, right? Note that we use the colon (:) indicate that we are at a new “digit”. In base 10, each digit can stand on its own.

## Try Base 16

If we want base 16, we could do something similar:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 (we’re getting full) 1:00 (16 – we’ve started a new digit)

However, we don’t want to write hexadecimal numbers with the colon notation (even though we could). We’d rather cook up separate symbols for 10-15 so we can just write numbers like we’re used to. We’ve run out of numbers (1-9 already used, with 0 as a placeholder) so we need some other symbols. We could use some squiggly lines or other shapes, but the convenions is to use letters, Roman style. Just like 5 became V, programmers use letters A-F to get enough digits up to 16. That is,

1 2 3 4 5 6 7 8 9 A (10 – we’re using the symbol “A”) B (11) C (12) D (13) E (14) F (15 – uh oh, we’re getting full) 10 (16 – we start a new digit)

Ahah! Now we can use one digit per “place”, and we know that 10 actually means we’ve “ticked over to 16″ once.

20 means we’ve ticked over to 16 twice (32).

25 means we’ve ticked over to 16 twice (giving us 32) and gone an extra 5. The total is 32 + 5 = 37.

## Quick review

With me so far? This is pretty cool, right? We can count in any system we want. Also notice that base 16 is more “space efficient” in the sense we can write a number like 11 in a single digit: B.

Base 16 really isn’t that different from base 10, we just take longer to fill up.

## The wonderful world of binary

We’ve seen plenty of base systems, from over-simple unary, to the unwiedly Roman numerals, the steady-going base 10 and the compact base 16.

What’s great about binary? In the spirit of keeping things simple, it’s the simplest number system that has the concept of “ticking over”. Unary, where we just write 1, 11, 111… just goes on forever. Binary, with two options (1 and 0) looks like this:

1: 1 2: 10 (we’re full – tick over) 3: 11 4: 100 (we’re full again – tick over) 5: 101 6: 110 7: 111 8: 1000 (tick over again) …

and so on.

Because binary is so simple, it’s very easy to build in hardware. You just need things that can turn on or off (representing 1 and 0), rather than things that have 10 possible states (to represent decimal).

Because it’s so simple, binary is also resistant to errors. If your signal is “partially on” (let’s say 0.4), you can assume that’s a zero. And if it’s mostly on (say 0.8), then you can assume it’s a 1. If you’re using a system with 10 possible states, it’s difficult to tell when an error occurred. This is one reason digital signals are so resilient to noise.

## Other examples of bases

We use other bases all the time, even dynamically changing bases. We usually don’t think of it that way:

Hours, minutes, seconds: 1:32:04

- We know this is 1 hour, 32 minutes, 4 seconds. In seconds, this is 1
*60*60 + 32*60 + 4.

Feet and inches: 3′ 5″

- This is 3 feet, 5 in or 3 * 12 + 5 inches.

Pounds and ounces: 8 lbs, 5 oz

- Since a pound is 16 oz, This is 8 * 16 + 5 oz. We’ve been using a base 16 number system all along!

## Parting thoughts

“10″ in any number system indicates the base, and means we’ve ticked over once. 10 in binary means two, 10 in decimal means ten, and 10 in hexadecimal is sixteen.

How do you keep these numbers apart? Programmers will often write “0b” in front of binary numbers. So 2 in binary is

0b10

Similarly, they’ll write 0x in front of hex numbers. So 16 in hex is:

0×10

If there aren’t any symbols (0b or 0x) in front, we assume it’s base 10, a regular number.

Now go forth and enjoy your new knowledge!

## Leave a Reply

87 Comments on "Number Systems and Bases"

wow. thanks, i feel smarter albeit nerdier already.

hey, this is a wonderful site, its really helped me in my assignment in college, but there is a question that i can’t answer and that is, Why do we use different number bases

Hi Alex, good question. I think we use binary (base 2) in computer systems because they are the easiest to build. It’s easier to make a switch that turns on or off (1 or 0) rather than one that has to go between 10 states.

For our choice of base 10, it’s probably because we have 10 fingers. Though some ancient civilizations used base 60, base 10 is pretty natural to us as we count off items on our hands.

[…] GUIDs are large, enormous numbers that are nearly guaranteed to be unique. They are usually 128 bits long and look like this in hexadecimal: […]

i want to know the history of the number system o to 9, when and why did it start

Hi Jacki, I don’t know that much about the actual history, but there’s some good information here:

http://en.wikipedia.org/wiki/Decimal#History

[…] And prime numbers are prime in any number system. “1/3″ is only a repeating fraction in base 10 (.33333), and you could even argue that pi (3.14159…) is not irrational in base “pi”. But everyone can agree that certain numbers are prime and can’t be divided. You can even transmit primes in a unary number system that lacks a decimal point: […]

Negative bases can be used, too. For example, base-negative-10. 0-9 are as in base-10, but 10[-10] is -10, 11[-10] is -9, …, 99[-10] = 81, 100[-10] = 100 (because -10 x -10 = 100). Seems silly, but I actually read a paper once in which using base-negative-two was useful for reducing the size of some electronic circuits.

Hi David, thanks for the info, that’s pretty interesting. I searched around and think it’s called “negabinary”: http://en.wikipedia.org/wiki/Negabinary

and there are some nice features like not having to store a separate sign bit. There’s even a number system with imaginary base, which is a bit mind-boggling:

http://en.wikipedia.org/wiki/Quater-imaginary_base

Appreciate the pointers!

this place is cool and helpful at the same time!!

[…] GUIDs are large, enormous numbers that are nearly guaranteed to be unique. They are usually 128 bits long and look like this in hexadecimal: […]

thats pretty cool

Thanks, glad you enjoyed it.

Hi kalid, could you elaborate a bit more on binary system,.me being less than average, need a bit more explanation and examples.

thanks

sudarshan

This best article i think to understand basic (bu very very very useful) thing of number system. thanks u alot.

@Sudarshan: Thanks for the comment — I might need to write a separate article on binary. The closest analogy I can think of it that binary is an odometer that “clicks over” when it reaches two — that is, you get 0, 1, then 10 (since you need to go the next digit).

@Jeet: Glad you enjoyed it.

Here’s an interesting pop quiz question for all you who just finished reading this page: which is a more powerful base for division, base 10 or base 16? Hint: The lesson on prime numbers will shed some light.

[…] Numbers: number systems, visual arithmetic, different bases, Prime numbers […]

hey indians found zero;

encint indian mthematics is so rich.

About 50 years back the currency system in India was base 16 system. One INR was divided by 16 to be called as one “paisa” but now , one paisa=1/100 INR

I just have to say, thank you! I have been researching all over the internet trying to understand the various Number Base Systems and your description just spelled it out for me. I think that all too often, Math experts do not know how to relate math concepts to the average person. Your clear and consise description was put into terms that I could understand. Thanks a lot.

Well I really think we live in a base 9 system if you ask Me. Consider this : 0 is a non number and you don’t get 9 until 9 is complete so the turn over is at the end of nine and when 10 starts it is just a fraction until 10 is complete which is really just a one again. so the end is at the end of nine or when we actually have nine in possession. so we Have nothing with a zero so that is not a number it is nothing at all so we start with 1 and proceed 23456789 then we have 10 11 12 13 14 15 16 17 18. then we have 19 20 21 22 23 24 25 26 27. Now what emerges is the true meaning of the number equation that is all the ones are lined up with the ones all the 2s with the 2s 3s with the 3s and so on now we consider the brake down by 3 or the square root of 9. Lets take a looksy

‘A’B’C

‘1’2’3

‘4’5’6

‘7’8’9

‘A”B”C

10 11 12

13 14 15

16 17 18

‘A”B”C

19 20 21

22 23 24

25 26 27

Tesla would be proud of my thinking I think

now consider A+B=C right 1+2=3 or 4+8=12 right you can even go a step farther and say A1+B2=C3 or 10+11( for 11 is 2 by the power of the nine and 10 is a 1)=21 or just another 3 or more accurately a multiple of 3 so to say line A + line A = multiple of 3 is accurate and more specific each position on the line added to a specific number on another line has a special relationship with the position of the end results so all in all there is nine numbers and zero is no number and 10 is like the octave in music or the same as 10 or to say 10 is the begging of the 2nd unit congruent with 1

Pretty tricky if you think about it. Yeah AxC is always C this is true. Check it for your self and see I am not lying. AxA=A BxB=A

Now these laws become real important when we try to understand the mechanics of Riemann’s non trivial zeros and the true meaning of prime numbers and how they interact in the whole scheme of things, Like for example how all prime numbers squared can only be in the 1,4,7, line. It is dictated by the law AxA=A and BxB=A yet CxC can only be a C for it is always in the 3,6,9,line by the fact of it being a multiple of 3.

So good luck and good fortune to all that read this. Long live the 3,5,7 and the 1,5,9 for it can show us even more wonders if you let it

Mikel

I propose writing a movie review according to this post! Some video tutorial!

I think if we were all used to using base 2, we will be good in maths since is simpler but I guess no one really up to learning a new system huh

Um, in ternary notation, I heard that “9” is written as “100” but “6” is written as “20”. Why did that big jump in numbers occur?