Binary Number System
Learn what the binary number system is, how it relates to decimal, octal, hexadecimal and base 64, and how to read bases and number notations.
To get off to a quick start talking about “binary,” let me show you a number expressed in the binary number system:
0 1 1 0 1 0 1 0
In this digital world, even if you don’t know what it means, that string of 0s and 1s probably looks familiar (you may have seen binary numbers in movies, TV shows, video games, books, or even browsing the internet, on some site about computers or computing).
Let me ask you, without having seen anything else on the subject: what can we say about the binary number above? If you go back and look at it, you’ll probably think “well, it has 8 bits” (each state “1” or “0” is a bit) and “it’s a sequence of bits” (in a computer, sequences of bits, depending on the context, are also called Data, Frame, Datagram, Segment, Instructions; lots of names, but for now you only need to understand that a “sequence of bits” is a string of “1s” and “0s,” nice and simple; we’ll see the rest of the names in other articles).
Binary is made up of bits (the famous 1s and 0s; all the information is in https://jarroba.com/bit/) and its size is measured with the system of units of information (you’ve surely heard of Megabits or Gigabytes, or symbols like Mib, Mb, Gb, GiB, kiB, kB, among many others; all of them are in https://jarroba.com/unidades-medida-la-informacion/).
Although binary, being a numeral system, can be used in your everyday life, for example to count things (replacing the decimal numeral system 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, which you’re surely bored of by now 😛 ), in a computer it’s used for two things:
- To store information. For example, saving a song (a song is stored in binary at the bit level on the hard drive of your favorite device, like your computer, laptop, smartphone, tablet, etc.).
- To give orders to the computer (more specifically called “Instructions”). For example, playing the saved song (an order in binary is electrical bits that make the processor do one thing or another, normally at a lower level than “playing a song,” such as arithmetic operations like binary additions or logical operations like the famous AND or OR, data control and memory operations like copying a register from memory to somewhere else, etc.).
So, if binary is a numeral system, is the binary sequence “01101010” a number? It is, but it can also mean other things. Any symbol we can think of can mean anything we want. For example, the letter “X” is a letter used to form words so we humans can communicate, but it’s also the symbol that marks where old pirates buried their treasure, or a variable in a math formula (for example, X+2=4 ), or the target you have to shoot at, or what we use to indicate on a form that we’ve ticked a box; the symbol “X” is a letter and also many other things, and it can even mean whatever we make up (and as we’ll see later, “X” can also mean the decimal number ten “10” ).
So what number is “01101010”? “01101010” is the number “01101010.” Wait, didn’t we just say it can mean other things? Yes, but it depends on the context. “01101010 binary” is a binary number that, if we convert it to the decimal numeral system, is the number “106 decimal.” We have to make clear where we start from (“01101010 binary”) and where we’re going (“106 decimal”). And how was the conversion done? Let’s not get ahead of ourselves; first, let’s understand what we mean by context. And what else does the binary number “01101010” represent? Also the color “dark blue.” A color? Yes, and also a letter, specifically the letter “j” (lowercase j). Is it possible for it to represent so many different things if “01101010” is always “01101010”? Precisely for that reason, it depends on the context, and it can mean many more things (like the symbol “X” mentioned before).
This binary number “01101010” could also represent endless things you can imagine in a computer, like a piece of a song or the position and color of the pixels of an image (or of a video frame).
Now that I’ve convinced you of everything that can be represented by exactly the same binary number, let’s get to the fun part: science, pure logic, numbers!
Numbers
A binary number is a number represented with 0s and 1s, but why do we represent binary with 0s and 1s and not with other symbols? We might think that zero is nothing and one is something, so it would easily equal off and on, darkness and light, evil and good, nothing and something, among many other more philosophical themes. However, that’s not the case; it has little to do with “off” and “on,” or “nothing” and “something.” It’s more like “something happens” or “something else happens” (curiosity is great, and if you have it, in the article about the bit we saw that a bit being represented with “0” or “1” only indicates different states at specific moments of a bit). So why were the symbols “0” and “1” chosen? Because we already had symbols we could reuse that we’re more than used to (and didn’t have to invent new ones).
The symbols of the decimal numbers we’re used to using: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (each of these symbols is called a “digit” or “figure”). Numbers are believed to have been invented in China, then reached India around the 5th century, from where they jumped to the Middle East around the year 670, and when the Arabs arrived in the Iberian Peninsula they took root because they were convenient, and they’ve been the ones used ever since, which is why they’re called “Arabic numerals” (or “digits”): they come from the Middle East. Then came the Spanish Reconquista (in the year 722 Spain began driving out the Arabs; more information about the Reconquista at Reconquista (Wikipedia) ) and Arabic numerals continued to be used (they were useful and already widely used, so there was no reason to get rid of those symbols). They spread across Europe in the Middle Ages, and then with European colonization of the American continent and the rest of the world their use became universal (more information about Arabic numerals at https://es.wikipedia.org/wiki/N%C3%BAmeros_ar%C3%A1bigos ).
All the cultures on our planet -Earth- represented numbers in one way or another. For example, the Egyptians used hieroglyphs (more information about Egyptian numerals at Sistema de numeración egipcio (Wikipedia) ), but their system, which was decimal, was lost and didn’t reach us (what did reach us were the “Arabic numerals” that we use).
There are also the famous Roman numerals, which represent quantities with symbols that grouped multiples of one and five (they’re still used today on some clocks, to number centuries like “XXI century,” or to count successive kings with the same name like “Alfonso X”).
Even in Prehistory (about 20,000 years ago), each unit was represented with a vertical stick, and the fifth one crossed out four vertical sticks to group them in multiples of five (more information at https://es.wikipedia.org/wiki/Cuenta_(matem%C3%A1ticas) ).
It’s quite a coincidence that such different cultures grouped their numbers by fives or by tens, so it’s assumed that our ancestors invented ten numbers because we count with the ten fingers of our hands (as kids we count on our fingers, and even as adults we use them to help with certain calculations).
Now we get to the present: we’re born and we’re taught “Arabic numerals.” They’re simple because there are ten numbers and each one is shown by a different symbol. And here comes the confusion: we always think in multiples of ten (“10”), which is the decimal system that uses the Arabic numerals as symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). Every ten things counted with these symbols, a group is made and the count restarts. That is, we count like this:
So, if we use a decimal system, it’s logical to assume there are other numeral systems like the following (below you’ll see lots of numbers; you don’t need to memorize everything, but it should ring a bell and you should know where to look the information up; you have the reminder both on this site and on many other places, free and at your disposal 🙂 ):
- Binary: has only two symbols to represent it (the symbols chosen for this numeral system are 0 and 1)
- Ternary: with three symbols (0, 1, 2)
- Quaternary: with four symbols (0, 1, 2, 3)
- Quinary: with five symbols (0, 1, 2, 3, 4)
- Octal: with eight symbols (0, 1, 2, 3, 4, 5, 6, 7)
- Decimal: with ten symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
- Hexadecimal: with sixteen symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Where the letter equals a decimal number: A=10, B=11, C=12, D=13, E=14, F=15. Writing these letters in uppercase or lowercase represents the same number, that is “B=b”)
- Trigesimal: with thirty symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T. Where the letter equals a decimal number: A=10, B=11, …, S=28, T=29. Writing these letters in uppercase or lowercase represents the same number).
- Base 32: with thirty-two symbols (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 2, 3, 4, 5, 6, 7. Where the letter equals a decimal number and the number symbols represent different decimal numbers: A=0, B=1, …, Y=24, Z=25, 2=26, 3=27, …, 6=30, 7=31. Writing these letters in uppercase or lowercase represents the same number).
- Base 64 (A curious numeral system widely used in computing to encode anything, like an image or a song, into letters and numbers): with sixty-four symbols (the chosen convention changes the order a bit compared to the previous ones, but the idea is the same, and I like it because it goes through the normal Arabic numeral symbols and the alphabet several times and you have to use uppercase and lowercase letters -in this base uppercase “B” is a different number than lowercase “b”- as well as two other symbols that depend on the protocol, like the plus sign “+” and the slash “/”. Generally the symbols chosen, in order, are: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, +, /)
Note
Note about “trigesimal” and other “-al” names::
I “half made up” the “trigesimal,” since it isn’t that widely used, but I wanted to include it so you’d have something to compare with. It really does exist, or could exist, just as there’s the “vigesimal” with 20 symbols, the “tetragesimal” with 40, the “pentagesimal” with 50, the “pentatrigesimal” with 35, the “centoctopentagesimal” with 158, but they aren’t used as widely as the others in computing (only a few numeral systems are used together with binary), which we’ll focus on in this article. I added it because we need another example to compare against “hexadecimal” (widely used alongside binary, as we’ll see). The base 32 above would be called “Duotrigesimal” and base 64 “Tetrahexagesimal.”
The complete table of the linguistic representation for the names of numeral systems used in computing (table courtesy of the RAE):
- 1: Unary
- 2: Binary
- 3: Ternary
- 4: Quaternary
- 5: Quinary
- 6: Senary
- 7: Septenary
- 8: Octal
- 9: Nonary
- 10: Decimal
- 11: Undecimal
- 12: Duodecimal
- 13: Tridecimal
- 14: Tetradecimal
- 15: Pentadecimal
- 16: Hexadecimal
- 17: Septemdecimal
- 18: Octodecimal
- 19: Nonadecimal
- 20: Vigesimal
- 21: Unvigesimal
- 22: Duovigesimal
- 23: Trigesimal
- …
For the tens:
- 10: Decimal
- 20: Vigesimal
- 30: Trigesimal
- 40: Tetragesimal
- 50: Pentagesimal
- 60: Hexagesimal
- 70: Septemgesimal
- 80: Octogesimal
- 90: Nonagesimal
For the hundreds:
- 100: Centesimal
- 200: Duocentesimal
- 300: Tricentesimal
- 400: Tetracentesimal
- …
The symbols used could be any you like: Arabic numerals, Egyptian hieroglyphs, Roman numerals, Prehistoric tally sticks, alien symbols, symbols each of us makes up at home, etc. Since we want to make the system universal (after all, it’s used for communicating between humans and it’s something basic), the use of Arabic numerals to count from zero to nine has been standardized in any numeral system (with a few exceptions). And for numeral systems that require more than ten symbols, other very widely used symbols are used: the alphabet itself (A, B, C, D, E, …).
I’ve told you all this story to help you understand the reality of numbers and escape the Matrix built around the decimal system (to change the usual perception that only zero to nine exist, and that Arabic symbols are reused for other numeral systems, as well as the alphabet or other symbols), and now to understand the properties of the binary system along with the different representations for each numeral system.
Base
Now a big question: how do we know which numeral system the number “101”, for example, is in? It clearly seems to be binary, but if we stop for a second to analyze it, we find that it could also be ternary (ternary also uses the symbols 0 and 1, as we saw above), or likewise quinary (which also uses the symbols 0 and 1), octal or decimal, hexadecimal, trigesimal or base 64. That is, this number could be expressed in any numeral system.
Another number, for example “97,” is clearly not binary (since binary only has the symbols “0” and “1,” we rule it out), and it can’t be ternary, quinary, or octal for the same reason; it could be any other numeral system from decimal onwards.
The base is nothing more than the number of symbols a numeral system has:
- Binary: base 2 (because it has “two” symbols, 0 and 1)
- Ternary: base 3 (because it has “three” symbols, 0, 1, and 2)
- Quaternary: base 4
- Quinary: base 5
- Octal: base 8
- Decimal: base 10
- Hexadecimal: base 16
- Trigesimal: base 30
- Base 32: base 32
- Base 64: base 64
On the other hand, you can say either “this number is binary” or “this number is base 2,” which means the same thing. It’s the same for all numeral systems (“base 64” doesn’t have an extra ordinal name like “sexagesimofourthary” might be; it’s always called “base 64,” the base is its own name and you simply say “this number is base 64”; although it wouldn’t be wrong to say “sexagesimofourthary,” it’s just that people are too lazy to say such a long word 🙂 ).
As we saw earlier with the example of the number “101,” we need a way to tell numeral systems apart, and for that we use the so-called “base,” which essentially means writing the base number small, to the right (a subscript) of the number in parentheses (for example, to say that the number “101” is binary, we write it with its base “(101)2”). This is how we tell which numeral system we’re talking about.
A few more quick examples for each base:
- Binary: (101)2, (101110101)2
- Ternary: (101)3, (1021222)3
- Quaternary: (101)4, (311021)4
- Quinary: (101)5, (340143)5
- Octal: (101)8, (47165142730)8
- Decimal: (101)10, (7046815392)10
- Hexadecimal: (101)16, (A8B3DF97310CD)16
- Trigesimal: (101)30, (1ACJQ97R80DTG)30
- Base 32: (101)32, (RG2EOGW4LD576FGO)32
- Base 64: (101)64, (sdHf7Gg+94DVra/E1fas)64
Note about subscripts: Sometimes you may see them without parentheses (for example, seeing the number “(101)2” as “1012”). This isn’t correct in quite a few cases, since it creates confusion, especially with variables. For example, for the variable “x,” saying “(x)2” is not the same as “x2”; “(x)2” means that whatever number “x” is, it’s binary, while “x2” represents one of the numbers in a sequence (x1 x2 x3 … xn). However, “101” is not a variable, so using “1012” instead of “(101)2” doesn’t cause confusion (personally I prefer using parentheses; I think it’s more effective and better to learn the universal standard).
Note
Is there a base 1 numeral system, a “unary” system? That is, isn’t binary the smallest one?:
The unary system exists and we’ve mentioned an example: the Prehistoric sticks, which have only a single symbol: the stick. Each time a stick ( | ) was drawn, the available symbols were used up, so you had to draw another one to represent the next quantity ( || ), and another for the next ( ||| ), and so on to infinity.
Today “unary code” is used to send data without loss (over the Internet, for example), to compress data without loss, to train neural networks, among other things. It uses the symbol “1” (remember that it isn’t a decimal 1; the symbol “1” was possibly chosen because it looks like a stick, and any other symbol like “5” or “%” could have been chosen; besides, where this “unary code” is used in computing is in bits, which work on a binary system). Here “1” in unary is 1 in decimal, “11” is 2 in decimal, “111” is 3 in decimal, and so on as far as we want. Since it’s used on bits (1 bit has two states, it’s a binary system), the binary “1” is used as the unary “1” and the binary “0” as a separator between groups of unary “1s” (for example, the unary number “111011011111” would be 325 in decimal); and sometimes it’s even used the other way around, with “0” as the unary symbol and “1” as the separator.
And as you’d expect, unary is base 1 and is represented with the subscript 1, for example: (11111)1
Note
A curiosity about an ancient base 60 system:
I didn’t want to finish this part without telling you one more curiosity. Earlier, when I told you the history of numbers, I mentioned that in ancient times people used their fingers to help with counting, and that’s why we now have the decimal system. Well, ancient Mesopotamia counted in base 60 (it had sixty symbols for its numeral system), and they also used their fingers to count, but with the finger segments (if you look at the palm of one of your hands, you’ll see that four fingers are divided into three parts by the lines where the finger bends, and the thumb wasn’t used for counting; so the 12 segments of one hand were used, without using the thumb’s segments, and with the other hand you raised the 5 fingers to group by 12s, so 12×5 = 60. More information about this sexagesimal system at Sistema sexagesimal (Wikipedia) )
We’ve now learned everything we needed to know about numbers. And this article is about “binary,” so we’ll stick only with the numeral systems that interest us and the most widely used ones in computing, which are: binary (naturally the one that interests us, it’s what the article is about 😉 ), octal, hexadecimal, base 64 (we’ll see what we need them for, since they’re closely related to binary), and decimal (this one doesn’t really interest us as much, but we’ll start from what we understand about this numeral system to understand the rest).
Representations
We’ve seen how bases are represented in the different numeral systems in a “general” way (in mathematics), but not how you’ll usually see them in computing (especially if you program). Below, I quickly show you other representations (some conventions come from some programming languages like C, although their use is quite widespread), and more examples with the base to serve as a reference:
- Binary: “0b” (zero and the letter “b”) is put before the number, or an uppercase “B” is put at the end, or “bin” is used as a subscript
- 0b00011010
- 00011010B
- 00011010bin
- (00011010)2
- Octal: “0o” (zero and the vowel “o”) is put before the number, or “oct” is used as a subscript
- 0o17824783
- 17824783oct
- (17824783)8
- Decimal (thousands separator punctuation symbols, like in “894.632.190.648,” aren’t used when programming): It’s represented with nothing in front, or a “D” is put at the end, or “dec” is used as a subscript
- 894632190648
- 894632190648D
- 894632190648dec
- (894632190648)10
- Hexadecimal: “0x” (zero and the letter “x”) is put before the number, or an uppercase “H” is put at the end (whether the letters that stand for numbers are uppercase or lowercase doesn’t matter in hexadecimal), or “hex” is used as a subscript; it can also be preceded by the hash sign “#”:
- 0xAE45782D
- ae45782dH
- AE45782Dhex
- #AE45782D
- (AE45782D)16
- Base 32:
- (34RZO7LE5BFS)32
- Base 64:
- (5IGNDh+cm5yhbCBw/DVra)64
- None, one “=” or two “==” equals signs at the end of the number (for example: dHJhc2dhcw== ): although they help tell these numbers apart, they’re not a way of representation since they’re padding characters (one “=” indicates 8 empty bits, two “==” are 16 empty bits; that is, if equals signs “=” appear, the number is shorter than it should be; for example, some protocols require the base 64 number to be a multiple of 24 bits, so if the number takes up 8 bits two equals signs “==” will be added, if it takes up 16 bits one equals sign “=” will be added, and if it takes up 24 bits no equals sign is added)
If you’re curious about how binary works, I recommend you take a look at the next article on combinations and conversions to and from binary by clicking here.
Acknowledgments
This article is dedicated especially to Jorge Moraleda, who was my math teacher at Obispo Perelló school. In class he always delighted us with curiosities about numbers, curiosities that were more than interesting and kept us paying attention, so much so that I still remember them today after so many years.
Attributions
“Table of the linguistic representation of the names of numeral systems” provided by the “Real Academia Española” in response to a query.
References
- The Number Base: Names of Number Bases (Radicologist)
- Sistema binario (Wikipedia)
- Binary prefix (Wikipedia)
- Base (aritmética) (Wikipedia)
- Sistema de numeración (Wikipedia)
- Base64 (Wikipedia)
- Unary coding (Wikipedia)
- Índice (matemática) (Wikipedia)
- Most significant bit (Wikipedia)
- Least significant bit (Wikipedia)
“Binary Number System” by Ramón Invarato at jarroba.com, licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0. Registered at Safe Creative.

You may also like
Binary: Combinations and Conversion
Learn how numeral system combination tables work and convert between binary, decimal, hexadecimal and octal with simple mental math.
Units of Measurement for Information
Learn the units of information: bit, byte, kilo vs kibi, GB vs GiB. Understand the old and new systems so nobody fools you about storage or speed.








Leave a comment