Binary Calculator
Do arithmetic and bitwise operations on binary, hexadecimal or octal numbers and see the answer in every base.
Working
How to use the Binary Calculator
- Pick the number systemChoose binary, hexadecimal, octal or decimal. Prefixes like 0b and 0x are accepted.
- Enter two numbers and an operationUse +, −, ×, ÷, or the bitwise operations AND, OR, XOR, NOT and shifts. NOT uses only the first number and the bit width you choose.
- Read every baseThe result is shown in binary (grouped in 4s), hex, decimal and octal, with the working laid out in columns.
Example
1011 + 110 = 10001 in binary, which is 11 + 6 = 17 in decimal (hex 11).
1100 AND 1010 = 1000, and NOT 00001011 in 8 bits is 11110100. In hex, FF ÷ 10 = F remainder F.
Frequently asked questions
How do you add binary numbers?
Like decimal addition, column by column from the right, but 1 + 1 = 10: write 0 and carry 1. And 1 + 1 + 1 = 11: write 1 and carry 1.
What are AND, OR and XOR?
They compare the bits in each position. AND gives 1 only if both bits are 1; OR gives 1 if either is 1; XOR gives 1 if exactly one is 1. They are used for masks, flags and permissions in programming.
How are negative numbers shown?
With a minus sign, plus their two’s complement form in the bit width you choose. In 8 bits, −1 is 11111111 and −5 is 11111011.