Binary Numbers

Overview of binary numbers

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!

How to count with binary numbers?

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.

Does binary start at 0 or 1?

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

Who invented the binary number system?

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.

What are binary numbers used for?

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.

Examples of binary numbers

Let's look at some common examples of what certain numbers are in binary and decimal.

Example 1: What is zero (0) in binary?

In binary zero is also 0.

Example 2: What is one (1) in binary?

In binary one is also 1.

Example 3: What is two (2) in binary?

In binary two is 10.

Example 4: What is three (3) in binary?

In binary three is 11.

Example 5: What is four (4) in binary?

In binary four is 100.

Example 6: What is sixteen (16) in binary?

In binary sixteen is 10000.

Example 7: What is thirty-two (32) in binary?

In binary thirty-two is 100000.

Example 8: What is sixty-four (64) in binary?

In binary two is 1000000.

Example 9: What is one-twenty-eight (128) in binary?

In binary two is 10000000.

Can binary numbers be negative?

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.

What is Two's Complement?

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.

What is One's Complement?

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.

Practice questions for binary numbers

Now that you have learned about binary numbers, try these twenty practice questions to help test your knowledge.

Calculators for binary numbers

Here are some calculators that can help you with binary numbers:

Converters for binary numbers

Here are some converters that can help you with binary numbers:

Further learning about binary numbers

Here are some resources that can help you learn more about binary numbers: