Binary is an alternative way of representing numbers with only two digits. These two digits are 1 and 0. Any number can be represented as a binary number using 1 and 0. Binary digits are used to represent numbers in computers and other digital systems.
Binary numbers can be used in much the same way as the decimal systems you were likely taught in school. In binary numbers, you can count, add, subtract, multiply and even divide!
Counting in binary is easy as we only have to worry about two digits. The first two numbers in binary are 0 and 1. Let’s look at how to count to ten in binary.
Binary numbers start at 0. The first number in binary is 0, the second number is 1, the third number is 10, the fourth number is 11 and so on. See the table below to learn how to count to ten with binary.
Decimal | Binary |
---|---|
0 | 0 |
1 | 1 |
2 | 10 |
3 | 11 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
8 | 1000 |
9 | 1001 |
10 | 1010 |
The invention of the binary number system can be attributed to Gottfried Wilhelm Leibniz (1646–1716). Leibniz was a prominent German mathematician contributions to various fields including binary numbers and calculus. You can learn more about it in our Leibniz and the history of binary in out tutorial What is binary.
Binary numbers are used to represent data in computer systems. The main use for binary numbers in computer systems is in memory systems (Such as Random Access Memory (RAM), hard drives and Solid State Drives (SSDs)) to store data in bits. They are also used for other parts of computer systems such as for IP addresses in networking, Logic Gates and Circuits like AND, OR, NOT and NOR gates. Other uses include cryptography, graphics and in image/video encoding.
Let's look at some common examples of what certain numbers are in binary and decimal.
In binary zero is also 0.
In binary one is also 1.
In binary two is 10.
In binary three is 11.
In binary four is 100.
In binary sixteen is 10000.
In binary thirty-two is 100000.
In binary two is 1000000.
In binary two is 10000000.
Yes, binary numbers can be used to represent negative numbers. Common ways of doing this include Two's Complement, One's Complement, Floating-Point Representation or simple Sign-Magnitude like used in decimal number systems.
In Two's Complement, you invert the bits in a binary number (change 0s to 1s and vice versa) and add 1 to the least significant bit. For example, to represent -4 in 8-bit binary using twos compliment you would first invert all the bits (change all 0s to 1s and all 1s to 0s) and then add one to the least significant bit. Using this method the result of the Twos Complemnt of -4 is 11111100.
One's complement uses a similar process to the above two's complement but you do not add 1. Therefore, the result of the Two's Complement of -4 is 11111011.
Now that you have learned about binary numbers, try these twenty practice questions to help test your knowledge.
Here are some calculators that can help you with binary numbers:
Here are some converters that can help you with binary numbers:
Here are some resources that can help you learn more about binary numbers: