Binary Calculator
Convert between binary, octal, decimal, and hex, or perform bitwise and arithmetic operations.
Convert instantly between binary, octal, decimal, and hexadecimal, or perform bitwise (AND, OR, XOR, NOT, shifts) and arithmetic operations directly on binary numbers.
How Binary Calculator Works
The converter reads your input in whichever base you select (binary, octal, decimal, or hex) and parses it into a plain decimal integer, then re-expresses that same decimal value in the other three bases by repeatedly dividing by the target base and reading off the remainders.
The arithmetic mode treats your entered binary strings as base-2 integers, performs the chosen operation — bitwise AND/OR/XOR compare the numbers bit by bit, while ADD/SUB/MUL/DIV work like ordinary arithmetic and left/right shift move every bit one or more positions — then converts the result back into binary, octal, and hex for display.
The 8-bit and 16-bit fields pad the binary result with leading zeros to a fixed width, which is useful for visualizing exactly how a value would be stored in a single byte or a 16-bit word in computer memory.
See It In Action
Who Uses Binary Calculator and Why
- Converting a number between binary, octal, decimal, and hex for a computer science homework problem.
- Checking the result of a bitwise AND, OR, or XOR operation while debugging low-level code.
- Visualizing exactly how a value would be stored in a single byte or 16-bit word using the padded output fields.
- Confirming that a left or right shift produces the expected multiply-or-divide-by-two-power result.
Mistakes to Avoid
- Treating bitwise AND like regular addition — it compares each bit position independently and never carries, producing a very different result from arithmetic addition.
- Forgetting that the 8-bit and 16-bit padded views only reflect the display width you selected, not an inherent property of the number itself.
- Misreading an octal number as decimal (or the reverse) since both use only digit characters and look similar at a glance.
Tips for Best Results
- Remember that shifting left by n positions is the same as multiplying by 2^n, and shifting right is the same as dividing by 2^n (rounding down).
- Use the 8-bit or 16-bit padded fields when you specifically need to see how a value is stored in a fixed-width binary format.
Fixing Common Problems
My XOR result doesn't match what I expected from adding the numbers. — XOR is a bitwise operation, not arithmetic — it compares each bit position independently rather than carrying like addition does, so don't expect it to behave like a sum.
Terms Explained
Bitwise operation: A calculation performed independently on each corresponding bit of two numbers, such as AND, OR, or XOR, rather than treating them as whole numbers.
One's complement: The result of a NOT operation, where every bit in a binary number is flipped (0 becomes 1, and 1 becomes 0).