Use this tool in **binary calculator** mode to perform arithmetic operations with binary numbers (add, subtract, multiply and divide binaries). Use it in **binary converter** mode to easily convert a binary number to a decimal notation real number, a decimal number to a binary number (decimal to binary and **binary to decimal converter**), as well as binary to hex and hex to binary.

Quick navigation:

- What is a binary number?
- Converting to and from binary numbers

- Binary to decimal
- Decimal to binary

## What is a binary number?

A binary number is a number expressed in the **binary system** which is a positional numeral system with a base of 2 which uses just 2 symbols: 0 and 1 to represent all possible numerical values. For example, 10 in decimal is 1010 in binary, 100 in decimal is 1100100 in binary, while 1,000 in decimal is 1111101000 in binary. Binary numbers have signs, just like decimal ones, for example -101 is equal to -5 in decimal. Negative numbers are, for the time being, not supported in the binary calculator / binary converter above.

While binary numerals were used historically in Egypt, China, India and other cultures, since the 20-th century they are predominantly used mostly in computing: computer system designers, software engineers and programmers etc. since the underlying computer systems encode everything with the presence or absence of an electrical charge. Thus, at the lowest level of abstraction everything in a computer system is represented by ones and zeroes. Most of us, thankfully, do not need to do any arithmetic or counting in binary, but a calculator or converter may often come into play in computer programming.

Using our binary calculator you can perform arithmetic operations (addition, subtraction, multiplication and division of binary numbers) as well as use it as a binary converter for binary to decimal, decimal to binary, hex to binary and binary to hex conversions.

Here is a table of some numbers represented in the decimal, hex and binary systems (base 10, base 2 and base 16).

Decimal | Binary | Hex |
---|---|---|

0 | 0 | 0 |

1 | 1 | 1 |

2 | 10 | 2 |

3 | 11 | 3 |

5 | 101 | 5 |

10 | 1010 | A |

11 | 1011 | B |

12 | 1100 | C |

13 | 1101 | D |

14 | 1110 | E |

15 | 1111 | F |

50 | 110010 | 32 |

63 | 111111 | 3F |

100 | 1100100 | 64 |

1000 | 1111101000 | 3E8 |

10000 | 10011100010000 | 2710 |

## Converting to and from binary numbers

Converting numbers to and from binary does not change the number itself, it just changes its form. Using our binary converter above, you can do both types of conversions quickly and easily or you can read how to do it manually below. Note that binary calculation and conversion are separate operations: you do not need to perform one in order to do the other.

### Binary to decimal

Each position in a binary numeral represents a power of 2 the same way each position in a decimal number represents a power of 10. For example, the number 20 in decimal is 2 · 10^{1} + 0 · 10^{0} = 20. The binary number 101 is then 1 · 2^{2} + 0 · 2^{1} + 1 · 2^{0} = 4 + 0 + 1 = 5 in decimal.

The process of binary to decimal conversion is therefore to take each position and multiply its value by 2 to the power of the position number, counting from right to left and starting at zero. If you need to calculate large exponents like 2^{16} you might find our exponent calculator useful.

### Decimal to binary

This process is a bit more complex as we are going from a higher base to a lower base. This is where you'd really appreciate having a tool like our binary converter handy. Let us say the number we want to convert from decimal to binary is X. Begin by finding the largest power of 2 ≤ X and denote it by E. Then determine how many times the power of 16 found above goes into X and make not of that. Denote the remainder by Y_{1}.

Repeat the above steps using Y_{n} as a starting value until 2 is larger than the remaining value and assing the remainder to the 2^{0} position, then assign each of the values Y_{1...n} to its respective position and you will have your hex value.

**Example decimal to binary conversion:** Convert 100 in decimal to hex.

1.) Largest power E = 6 (2^{6} = 64 ≤ 100, 2^{7} = 128 ≥ 100)

2.) 100 / 2^{6} = 1 (36 remainder); Y_{1} = 1

3.) Largest power E = 5 (2^{5} = 32 ≤ 36, 2^{6} = 64 ≥ 36)

4.) 32 / 2^{5} = 1 (4 remainder); Y_{2} = 1

5.) Largest power E = 2 (2^{2} = 4 ≤ 4, 2^{3} = 8 ≥ 4)

6.) 4 / 2^{2} = 0 (0 remainder); Y_{3} = 0

7.) 0 < 2; end.

For each power you have used place in its position. For the remainder place zeroes. In this case we've used powers of 2, 5 and 6, therefore the result is: **11**00**1**00 (**1** · 2^{6} + **1** · 2^{5} + 0 · 2^{4} + 0 · 2^{3} + **1** · 2^{2} + 0 · 2^{1} + 0 · 2^{0}).

Hex to binary and binary to hex conversion follows the same principles, but with base 16 instead of base 10.

## Arithmetic operations with binary numbers

Using our tool in binary calculator mode you can perform the four basic arithmetic operations on binary numbers: addition, subtraction, multiplication and division. E.g. it can easily be used as a binary addition calculator. In order to do the binary calculations yourself most would prefer using a table for smaller numbers and a calculator for larger ones. Subtraction works the same way as any other number system, except when borrowing a number you need to borrow a group of 2_{10} instead of 10_{10} as you would with decimals.

## Binary arithmetic calculation examples

A few examples of using base 2 numbers will be instructional in showing that it works similarly to ordindary decimal numbers. A simple simple to start with: add 10_{2} and 11_{2}. Adding these two binary numbers starting from right-to-left is 0 + 1 = 1, 1 + 1 = 10 so that is 0 with a carry of 1_{2} so we get 01_{2} and when the carry is added at the front we get the result: 101_{2}.

For a more complex addition example let us add the hex numbers 111_{2} and 101_{2}. Starting from right to left:

- (1) Add 1
_{2}and 1_{2}, resulting in 10_{2}, which is**0**and carry 1_{2}_{2}over to the left. - (2) Add 1
_{2}and 0_{2}, then add 1_{2}from the carryover, resulting in**0**and a carry of 1_{2}_{2}. - (3) Add 1
_{2}and 1_{2}and the 1_{2}carried over from (2) to get**11**._{2} - Write down the outcome of (3), (2) and (1) next to each other to get
**1100**- the result of adding the binary numbers 111 and 101._{2}

This is how binary addition works, and likewise for binary subtraction, multiplication, and division.