Binary Calculator

    Perform arithmetic and bitwise operations on binary numbers.

    Runs in your browser. Nothing is uploaded.No signup requiredBuilt byDATAMETA LAB

    How to use this tool

    1. Enter binary numbers (0s and 1s only)
    2. Select the operation to perform
    3. Choose the bit width for the result
    4. Click Calculate to see results in multiple formats

    About this tool

    Binary Calculator performs arithmetic (add, subtract, multiply, divide) and bitwise (AND, OR, XOR, NOT) operations on binary numbers. Results are shown in binary, decimal, hexadecimal, and octal formats. The bit width setting controls how many bits are used for the result.

    Frequently asked questions

    What can this calculator do?

    Arithmetic on binary numbers, meaning addition, subtraction, multiplication and division, and bitwise operations, meaning AND, OR, XOR and NOT. Every result is shown in binary, decimal, hexadecimal and octal at once.

    What is the difference between arithmetic and bitwise operations?

    Arithmetic treats the input as a number, so 0011 plus 0001 is 0100, which is three plus one. Bitwise treats it as a row of independent switches and compares them position by position, so 0011 AND 0001 is 0001. They give different answers because they are asking different questions.

    What do AND, OR, XOR and NOT actually do?

    AND gives 1 only where both inputs have a 1, which is how you mask out bits you do not want. OR gives 1 where either has one, which is how you switch bits on. XOR gives 1 where exactly one has a 1, which is how you toggle bits and the basis of simple checksums. NOT inverts every bit.

    Why does the bit width setting matter?

    Because it decides what happens when a result will not fit. In an 8-bit width, adding 255 and 1 wraps around to 0 rather than giving 256, exactly as it would in a real 8-bit register. It also determines how many leading bits NOT flips. Set it to match the system you are reasoning about.

    How do I represent negative numbers in binary?

    With two's complement, which is what virtually every processor uses: invert every bit of the positive value and add one. In eight bits, minus 5 is 11111011. The top bit acts as a sign, which is why an 8-bit signed range runs from minus 128 to 127 rather than 0 to 255.

    Why do I need to know binary arithmetic?

    It explains a lot of otherwise mysterious behaviour: integer overflow, why permission flags are combined the way they are, how subnet masks select a network, why hash and checksum code is full of XOR, and why a value silently becomes negative when it exceeds a type's range.