Skip to content

DIY Cost Tools

Binary Calculator

Add, subtract, multiply or divide two binary integers. See the exact result in base 2, decimal and hexadecimal, plus a remainder for division. Useful for checking binary homework, learning number systems and comparing integer representations.

Enter 0s and 1s only, up to 256 digits per number. An optional + or − sign (type a hyphen for −) and 0b prefix are accepted. For example, −0b101 means negative five. No internal spaces or decimal points.

Binary result (base 2)10000
Decimal result (base 10)16
Hexadecimal result (base 16)10

Decimal check: 10 + 6 = 16.

How to use the binary calculator

  1. Type each number in binary. The input 10 means two, not ten.
  2. Choose an operation and select Calculate binary result. Pressing Enter also calculates.
  3. Read the answer in your preferred base. For division, read both the integer quotient and the remainder.

How binary place value works

Each digit represents a power of two. Starting on the right, the place values are 1, 2, 4, 8, 16 and so on. Multiply each place value by its digit, then add the contributions. For a binary integer with digits bk, its decimal value is Σ bk × 2k, where the rightmost digit has k = 0.

Thus 1010 means 1 × 8 + 0 × 4 + 1 × 2 + 0 × 1 = 10. A minus sign negates that value. The calculator performs the selected operation on those exact integers, then writes the same result in three bases. Hexadecimal uses digits 0–9 and A–F; its output is not prefixed with 0x.

Worked examples

Addition: With the default inputs, 1010 is decimal 10 and 110 is decimal 6. Their sum is 16, which is binary 10000 and hexadecimal 10. In binary addition, 1 + 1 produces 10: write 0 and carry 1 to the next column.

Division: Enter A = 1101, B = 11 and choose Divide. Decimal 13 divided by 3 gives quotient 4 and remainder 1. The binary quotient is 100 and the binary remainder is 1. Check: 13 = 3 × 4 + 1.

Division, negative numbers and limits

Division returns an integer quotient, with any fraction truncated toward zero. The remainder has the same sign as A unless it is zero. For −1101 ÷ 11, the quotient is −100 (−4) and the remainder is −1. Always check A = B × quotient + remainder.

This tool uses exact integer arithmetic rather than floating-point approximations. Leading zeros are allowed in inputs and removed in results. It does not use a fixed word size, overflow wrapping, two’s-complement encoding, bitwise operators or fractional binary arithmetic. A negative output uses a visible minus sign. If a programming assignment requires 8-, 16- or 32-bit representations, use its stated encoding and width separately. Input size is limited to 256 binary digits per operand; a multiplication result can be longer. Division by zero is rejected.

Frequently asked questions

Can I enter a decimal number?

Both fields accept binary digits only. Decimal 10 must be entered as 1010. Entering 10 is valid binary and represents decimal 2.

Why does 1 divided by 10 give zero?

That is decimal 1 divided by 2. This integer calculator reports quotient 0 with remainder 1, rather than the fractional binary value 0.1.

Are leading zeros or a 0b prefix allowed?

Yes. Inputs 00101, 101 and 0b101 all represent decimal 5. A sign comes before the prefix, as in −0b101. Internal separators are rejected to avoid ambiguity.

Why is hexadecimal 10 equal to decimal 16?

In base 16, the rightmost position counts ones and the next counts sixteens. Hexadecimal 10 means one sixteen and zero ones.

Review notes and reference

Reviewed October 3, 2026. The default addition and division examples, negative division, zero handling, large integer arithmetic and invalid-input cases were checked against expected values. The implementation uses JavaScript BigInt, documented by MDN’s BigInt reference. This is an educational arithmetic tool; it does not simulate a particular processor or programming language’s fixed-width integer rules.

Related tools

Math calculators · Scientific Calculator · Exponent Calculator · Data Storage Converter · Roman Numeral Converter · All calculators