Binary Calculator
Convert between binary, decimal, octal, and hexadecimal. Perform binary arithmetic and bitwise operations (AND, OR, XOR, NOT).
Binary = Σ(digit × 2^position)Conversions
Binary
1010
Mode
Input Base
Valid characters: 0-1
Value to Convert
Conversion Results
Binary (Base 2)
1010
Decimal (Base 10)
10
Octal (Base 8)
12
Hexadecimal (Base 16)
A
Binary Position Values
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Power of 2 | 2^7 | 2^6 | 2^5 | 2^4 | 2^3 | 2^2 | 2^1 | 2^0 |
| Decimal Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Example: 11001010 = 128 + 64 + 8 + 2 = 202
Common Conversions
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
Conversions
Binary
1010
?How to Convert Binary Numbers
To convert binary to decimal, multiply each binary digit (0 or 1) by its positional power of 2 (right to left: 1, 2, 4, 8, 16...) and sum the results. For example, binary 1101 = 1x8 + 1x4 + 0x2 + 1x1 = 13 decimal. To convert decimal to binary, repeatedly divide by 2 and read remainders bottom-to-top.
What is Binary?
Binary is a base-2 number system that uses only two digits: 0 and 1. Each position in a binary number represents a power of 2, making it the fundamental language of computers and digital electronics. Binary arithmetic and conversions are essential for programming, computer science, and understanding how digital systems process information.
Key Facts About Binary Numbers
- Binary (base-2) uses only digits 0 and 1; each position represents a power of 2
- Binary to decimal: multiply each digit by 2^position and sum (1011 = 8+0+2+1 = 11)
- Decimal to binary: divide by 2 repeatedly, collect remainders bottom-to-top
- 4 binary digits = 1 hexadecimal digit (1111 = F, 1010 = A)
- Bitwise AND: returns 1 only if both bits are 1
- Bitwise OR: returns 1 if either bit is 1
- Bitwise XOR: returns 1 if exactly one bit is 1
- Computers use binary because circuits have two states: on (1) and off (0)
Quick Answer
To convert binary to decimal, multiply each binary digit (0 or 1) by its positional power of 2 (right to left: 1, 2, 4, 8, 16...) and sum the results. For example, binary 1101 = 1x8 + 1x4 + 0x2 + 1x1 = 13 decimal. To convert decimal to binary, repeatedly divide by 2 and read remainders bottom-to-top.
Frequently Asked Questions
Binary is a base-2 number system using only 0 and 1. Each position represents a power of 2. For example, 1011 in binary = 1×8 + 0×4 + 1×2 + 1×1 = 11 in decimal. Computers use binary because electronic circuits have two states: on (1) and off (0).
Multiply each binary digit by its positional power of 2 (right to left: 1, 2, 4, 8, 16...) and sum the results. Example: 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 8 + 4 + 0 + 1 = 13.
Repeatedly divide by 2 and collect remainders from bottom to top. Example: 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1. Reading remainders upward: 1101.
Bitwise operations compare bits position by position. AND: both must be 1 to get 1. OR: either can be 1 to get 1. XOR: exactly one must be 1 to get 1. NOT: flips each bit. These are fundamental to computer logic and programming.
Hexadecimal (hex) is base-16 using digits 0-9 and letters A-F (10-15). It's compact for representing binary (4 binary digits = 1 hex digit). Used for colors (#FF0000 = red), memory addresses, and programming. 255₁₀ = FF₁₆ = 11111111₂.
Last updated: 2025-01-15
Conversions
Binary
1010