Binary Calculator
Perform binary arithmetic and bitwise logic operations.
Counting with two symbols
Binary is base 2: each position is worth twice the one to its right, so 1011 is8 + 0 + 2 + 1 = 11. Converting the other way, repeatedly divide by 2 and read the remainders bottom to top. Computers use it because a circuit reliably distinguishes two states — on and off — far more robustly than ten.
Arithmetic follows the same rules as decimal with a smaller alphabet: 1 + 1 = 10, carrying into the next column. Negative numbers are normally stored as two's complement — invert every bit and add one — which lets the same adder circuit handle subtraction and gives one unambiguous zero. The asymmetric range that follows, −128 to 127 in eight bits, is a direct consequence.
Bit shifting is multiplication and division by powers of two: shifting left one place doubles, shifting right halves. Hexadecimal exists as shorthand — one hex digit maps to exactly four bits, so a byte is two clean hex characters, which is why memory addresses and colour codes are written that way rather than as long binary strings.
Frequently Asked Questions
How do binary operations work?
Binary numbers use base 2 (digits 0 and 1). Operations compute values in decimal and convert the output back to binary format.
What bitwise operations are supported?
Supported operations include Addition (+), Subtraction (-), Multiplication (×), Division (÷), AND (&), OR (|), and XOR (^).
How do I convert binary to decimal?
Multiply each bit by 2 raised to its position from the right, starting at zero, and add. So 1011 is 8 + 0 + 2 + 1 = 11. Converting the other way, divide repeatedly by 2 and read the remainders from the bottom up.
How are negative numbers represented in binary?
Almost always in two's complement: invert every bit of the positive value and add one. It lets the same addition circuitry handle signed and unsigned arithmetic, and it is why an 8-bit signed byte ranges from -128 to +127 rather than -127 to +127 - there is only one representation of zero.