Skip to content

Binary Calculator

Add, subtract, multiply, and divide binary numbers with decimal and hex output. Enter binary values such as 1010 and 11, then choose the arithmetic operation.

1010 + 11
Binary1101
Decimal13
Hex0xD

Binary Arithmetic Rules

Binary arithmetic uses base 2, so every digit is either 0 or 1. Addition carries when a column reaches 2, subtraction borrows from the next column, and multiplication works like decimal long multiplication with shifted partial products.

Code Examples

const a = BigInt('0b1010');
const b = BigInt('0b11');

const sum = a + b;        // 13n
const binary = sum.toString(2); // "1101"

Frequently Asked Questions

How do I add binary numbers?

Binary addition follows the same carry rules as decimal addition, but each column can only contain 0 or 1. 1 + 1 becomes 10, so you write 0 and carry 1 to the next column.

Can this binary calculator divide numbers?

Yes. Enter two binary numbers and choose Divide to get the quotient plus any remainder. Division by zero is blocked with an error message.

Can I use 0b prefixes?

Yes. The calculator accepts plain binary like 1010 and prefixed binary like 0b1010. Results are shown in binary, decimal, and hexadecimal.

Related Tools