Binary Calculator
Add, subtract, multiply, and divide binary numbers. Convert between binary, decimal, and hex.
How to Use the Binary Calculator
- Select an operation: Convert, Add, Subtract, Multiply, or Divide.
- Enter binary numbers using only 0s and 1s in the input fields.
- For arithmetic operations, enter two binary values (A and B).
- Click the operation button to see the result in both binary and decimal formats.
- The Convert tab shows binary, decimal, hex, and octal representations of a single value.
Formula & Method
Binary to Decimal:Decimal = sum(bit x 2^position)
Example: 1010 = (1x2^3) + (0x2^2) + (1x2^1) + (0x2^0) = 8 + 0 + 2 + 0 = 10
Binary Addition: Add bit by bit from right to left, carrying 1 when sum exceeds 1.
Binary Subtraction: Subtract bit by bit, borrowing 2 when the top bit is smaller.
Binary Multiplication: Similar to decimal multiplication, but using only 0 and 1.
Binary Division: Repeated subtraction of the divisor, tracking quotient bits.
Examples
| Operation | A | B | Binary Result | Decimal Result |
|---|---|---|---|---|
| Add | 1010 | 1100 | 10110 | 22 |
| Subtract | 1010 | 0011 | 111 | 7 |
| Multiply | 101 | 11 | 1111 | 15 |
| Divide | 1010 | 10 | 101 (rem 0) | 5 |
| Convert | 11110000 | - | 0xF0 / 360 / 0o360 | 240 |
Frequently Asked Questions
What is binary?
Binary (base-2) is a number system that uses only two digits: 0 and 1. It is the fundamental language of computers because electronic circuits have two states: on (1) and off (0). All data in computers is ultimately stored and processed in binary.
How do I read binary numbers?
Each position in a binary number represents a power of 2, starting from the right (2^0 = 1). For example, 1010 = (1x8) + (0x4) + (1x2) + (0x1) = 10 in decimal.
Can I do complex math with this binary calculator?
This calculator handles basic arithmetic (addition, subtraction, multiplication, division) and conversions. For very large numbers or complex operations, the results may be limited by JavaScript number precision (up to 53 bits of precision).
What is the difference between binary and Boolean logic?
Binary is a number system for representing values. Boolean logic is a system of algebra for logical operations (AND, OR, NOT). While both use 0 and 1, binary represents quantities while Boolean represents true/false states.
People Also Ask
What is 1010 in decimal?
The binary number 1010 equals 10 in decimal. Calculation: (1x8) + (0x4) + (1x2) + (0x1) = 10.
How do you add binary numbers?
Add bit by bit from right to left, just like decimal addition. 0+0=0, 0+1=1, 1+0=1, 1+1=10 (write 0, carry 1). For example, 1010 + 1100 = 10110 (10 + 12 = 22).
What is the largest binary number with 8 bits?
The largest 8-bit binary number is 11111111, which equals 255 in decimal. With n bits, the maximum value is 2^n - 1.
How do computers use binary?
Computers use binary because electronic circuits have two states: high voltage (1) and low voltage (0). All data, including text, images, and instructions, is encoded as binary. CPUs perform arithmetic and logic operations directly on binary values.