Skip to main content

Bitwise & integer math

Binary Calculator

Binary calculator with bitwise operations (AND, OR, XOR, NOT, NAND), bit shifting, 2's complement, and real-time decimal/hex/octal conversions. Perfect for computer science and digital logic.

By Jeff Beem

Updated

Binary Inputs & Operations

Decimal: 11

Hex: 0xB

Decimal: 13

Hex: 0xD

Result

Enter binary numbers to see result

Results update automatically as you type

1011 + 1101 = 11000

1011 plus 1101 is 11000 in binary, which is 24 if you convert it. You keep writing 0 and carrying 1 left until the answer needs five bits, not four. You can also subtract, multiply, and divide in the same two boxes, and decimal and hex show up under each field as you type.

Where people get surprised

Addition is mostly carries

In binary, 1 + 1 is 10: you write 0 and carry 1. On 1011 + 1101, you carry three times in a row and end up with 11000, not a four-bit answer. If your hand work stopped at 1010, rerun it from the rightmost column.

Subtraction flips bits, then adds

To do 1011 โˆ’ 1101, flip 1101 to 0010, add 1 to get 0011, then add that to 1011. You get 1110. The decimal line under the result says 14, not โˆ’2, because we are not forcing 8-bit or 16-bit signed rules. Your syllabus might; this page does not.

Multiplication is a pile of shifted adds

For each 1 in the bottom number, you add the top number shifted left; 0s add nothing. 1011 ร— 1101 comes out 10001111, which is 143 in decimal. It is tedious on paper and fast here.

The binary answer can outgrow the decimal label

Homework-length strings are fine: 1011 still shows as 11 underneath. If you paste something enormous, the +/ร— math may still run, but the decimal and hex under the boxes can go wrong past about 53 bits. When that happens, trust the binary string, not the side number.

Binary calculator: add, subtract, multiply, and divide in base 2

1011 + 1101 = 11000 (24 in decimal). Subtraction flips bits and adds; division gives the quotient only, not the remainder. Decimal and hex under the boxes are reliable for normal homework, not for absurdly long bit strings.

What this calculator does

Two fields of 0s and 1s, four operations (+ โˆ’ ร— รท), and decimal/hex printed under each field when the value is not huge. Most people open it to check an assignment: did I carry correctly, flip the right bits for subtraction, or stack the partial products for multiply?
  • Outputs:
    Binary result plus decimal and hex when the value fits safe integer parsing. Operand fields show the same conversions live.
  • Limits:
    No fixed-width signed mode (8/16/32-bit two's complement with overflow discard). No floating-point binary, shifts, or bitwise AND/OR/XOR. Division returns the integer quotient only, not remainder. Decimal/hex side labels lose accuracy past ~53 bits even if the binary operation still completes.

The math

Positional value in base 2: each bit is a power of two. Decimal conversion sums those powers; hex groups nibbles of four bits.
Decimal=โˆ‘i=0nโˆ’1biร—2โ€‰i\text{Decimal} = \sum_{i=0}^{n-1} b_i \times 2^{\,i}
  • Addition:
    Column sums from the right; carry 1 when a column totals 2 or 3. 1011 + 1101 โ†’ 11000 (24).
  • Subtraction:
    Pad to equal length, 2's complement the subtrahend (invert, +1), add. 1011 โˆ’ 1101 โ†’ 1110 as bits; decimal under the result reads 14 unless you interpret a specific width.
  • Multiplication:
    Shift-and-add: 1011 ร— 1101 โ†’ 10001111 (143). Uses big integers internally.
  • Division:
    Integer quotient in binary. 1101 รท 101 โ†’ 10 (13 รท 5 = 2). Remainder 11 (3) exists on paper but is not listed in the UI.
  • Hex grouping:
    1011 1101 โ†’ BD. Pad the leftmost group to four bits if needed.

Using the calculator

Defaults load 1011 and 1101 so you can hit calculate immediately. Swap exchanges the two operands.
  • Operands:
    Only 0 and 1. Leading zeros are fine; subtraction trims leading zeros on the result.
  • Operations:
    + addition, โˆ’ subtraction (2's complement add), ร— multiplication, รท integer division (quotient only).
  • Errors:
    Divide by zero shows an error. Bad characters are filtered with a short message.
  • History:
    Last ten lines in the session; not saved to a server.
  • Privacy:
    Runs in the browser; nothing is uploaded.

FAQ

How do I add binary numbers?

Add bit columns right to left; when a column sums to 2, write 0 and carry 1 (or write 1 and carry 1 for 1+1+1). Example: 1011 + 1101: rightmost 1+1 โ†’ 0 carry 1, then 1+0+1 โ†’ 0 carry 1, then 0+1+1 โ†’ 0 carry 1, leftmost 1+1+1 โ†’ 1 carry 1. Result 11000 (24 decimal). The tool does the carries for you and shows binary, decimal, and hex.

How does subtraction work here?

The tool subtracts by adding the 2's complement of the second operand (flip bits, add 1), padded to the longer string. Example: 1011 โˆ’ 1101 (11 โˆ’ 13): complement of 1101 is 0011; 1011 + 0011 = 1110. There is no fixed bit width, so the decimal line under the result is an unsigned parse (14 here), not โˆ’2. Signed โˆ’2 would need an agreed width (e.g. 4-bit two's complement).

How do I multiply binary numbers?

Same long-multiplication idea as decimal, but each multiplier bit is only 0 or 1. For each 1, add a left-shifted copy of the multiplicand. 1011 ร— 1101 (11 ร— 13) = 10001111 (143 decimal). Multiplication uses arbitrary-size integers in the browser; very long strings are fine for the product itself.

How does division work?

Integer division: 1101 รท 101 (13 รท 5) gives quotient 10 (2 decimal). The page shows the quotient in binary, decimal, and hex; it does not print a remainder line (5 รท 2 would leave remainder 1 on paper, but only the quotient appears). Division by zero (divisor 0 or empty) shows an error.

How do I convert binary to decimal?

Sum powers of two where the bit is 1. 1011 = 8 + 2 + 1 = 11. Input fields update decimal and hex as you type when the value fits in JavaScript's safe integer range (about 53 bits).

How do I convert binary to hexadecimal?

Group bits in fours from the right; pad the left group with zeros if needed. 1011 1101 โ†’ 1011 = B, 1101 = D โ†’ BD. Hex under each field follows the same parseInt path as decimal, so huge bit strings can misread on the conversion lines even when the binary math still runs.

What happens if I type something other than 0 or 1?

Non-binary characters are stripped. You get a short error if you typed a bad character; it clears after about two seconds. Only 0 and 1 stay in the operand fields.

How long can the binary strings be?

Addition and subtraction walk the bit strings directly. Multiplication and division use big integers, so they scale further than desk calculators capped at 32 or 64 bits. Decimal and hexadecimal labels beside inputs and results use standard integer parsing, which goes inaccurate past roughly 253 โˆ’ 1. For classroom-sized numbers you are fine; for megabit-wide strings, trust the binary result, not the decimal readout.

Mathematical Reference Note

Calculation Logic: This tool uses standard mathematical algorithms. While we strive for accuracy, errors in logic or user input can result in incorrect data.

Verification: Results should be cross-checked if used for important academic, professional, or personal calculations.

Standard Terms: This tool is provided free of charge and as-is. CalcRegistry provides no warranty regarding the accuracy or fitness of these results for your specific needs.

ยฉ 2026 CalcRegistry Reference Last System Check: May 2026Free Online Utility Tools