Binary Calculator

Convert between binary and decimal or perform binary arithmetic with step-by-step results. See the complete solution with step-by-step working and formula explanations.

Enter your values above to see the results.

Tips & Notes

  • Powers of 2: 1,2,4,8,16,32,64,128,256,512,1024. Memorize these for fast conversion.
  • Binary addition carry: 1+1=10₂. Write 0, carry 1. Just like decimal 9+1=10.
  • Leftmost bit = Most Significant Bit (MSB). Rightmost = Least Significant Bit (LSB).
  • 8 bits = 1 byte. 1 byte holds values 0−255. 2 bytes hold 0−65535.
  • Shortcut decimal→binary: repeatedly subtract largest fitting power of 2. 25=16+8+1=11001₂.

Common Mistakes

  • Reading remainder order wrong in divide-by-2 method — read FROM BOTTOM to top.
  • Binary carries: 1+1+1=11₂ (not 3). Write 1, carry 1.
  • Confusing binary (base 2) with octal (base 8) or hex (base 16) — different bases.
  • Forgetting leading zeros in fixed-width representations. 4-bit: 5=0101 not 101.
  • Bitwise AND vs logical AND: 1010 AND 1100 = 1000 (bitwise), not True/False (logical).

Binary Calculator Overview

Binary (base 2) is the numeral system used by every digital computer, processor, and electronic circuit ever built. It uses only two digits — 0 and 1 — corresponding directly to the two stable states of electronic switches: off (0) and on (1). All data in a computer, whether text, images, audio, or programs, ultimately consists of sequences of binary digits (bits). Understanding binary arithmetic reveals how computers actually compute at their most fundamental level, from simple addition to cryptographic operations.

Binary to Decimal conversion — multiply each bit by its positional power of 2:

EX: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀
EX: 11111111₂ = 128+64+32+16+8+4+2+1 = 255₁₀ (maximum value of 1 byte)
Decimal to Binary conversion — divide by 2 repeatedly, collect remainders bottom-to-top:
EX: 13 → 13÷2=6 R1 → 6÷2=3 R0 → 3÷2=1 R1 → 1÷2=0 R1 → read upward: 1101₂ | verify: 8+4+0+1=13✓
Powers of 2 reference: 2⁰=1, 2¹=2, 2²=4, 2³=8, 2⁴=16, 2⁵=32, 2⁶=64, 2⁷=128, 2⁸=256, 2⁹=512, 2¹⁰=1024. Memorizing these makes binary conversion immediate for values up to 1023. Binary addition — same rules as decimal but carrying at 2 instead of 10: 0+0=0 | 0+1=1 | 1+0=1 | 1+1=10 (write 0, carry 1) | 1+1+1=11 (write 1, carry 1)
EX: 1011₂ + 0111₂ → rightmost: 1+1=10(write 0,carry 1) → 1+1+1=11(write 1,carry 1) → 0+1+1=10(write 0,carry 1) → 1+0+1=10(write 10) → 10010₂ = 18₁₀ | check: 11+7=18✓
Two's complement — the standard representation of negative integers in computers. To negate: flip all bits, then add 1. In 8-bit: 5 = 00000101 → flip = 11111010 → add 1 = 11111011 = −5. Range: −128 to +127 for 8-bit. 32 bits (0–~4.3 billion). 64 bits (0–~18.4 quintillion). The 32-bit address space limit (4 GB) explains why Windows XP could not address more than 4 GB of RAM. Binary arithmetic is not just the language computers use — it is the language they think in at the hardware level. Every addition, subtraction, multiplication, and comparison in a processor is implemented as a circuit operating on binary signals. The XOR gate computes binary addition without carry. The AND gate computes the carry bit.

Frequently Asked Questions

Binary is base 2, using only digits 0 and 1. Each position represents a power of 2: rightmost = 2⁰=1, next = 2¹=2, then 2²=4, 2³=8, and so on. To convert binary to decimal: multiply each bit by its positional power and sum. 1011₂ = 1×8 + 0×4 + 1×2 + 1×1 = 8+0+2+1 = 11₁₀. To convert decimal to binary: divide repeatedly by 2, collecting remainders bottom-to-top. 13 → 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → read upward: 1101₂.

Binary addition uses carrying at 2 instead of 10. Rules: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (write 0, carry 1), 1+1+1=11 (write 1, carry 1). Example: 1011 + 0110. Rightmost: 1+0=1. Next: 1+1=10 (write 0, carry 1). Next: 0+1+1(carry)=10 (write 0, carry 1). Leftmost: 1+0+1(carry)=10. Result: 10001₂ = 17₁₀. Verify: 11₁₀ + 6₁₀ = 17₁₀ ✓. Each step is identical to decimal addition — only the carrying threshold differs.

Binary subtraction uses borrowing at 2 instead of 10. When the top digit is smaller than the bottom digit, borrow from the left: borrowing 1 from the next position gives 2 in the current position (not 10 as in decimal). Example: 1101 − 0101. Rightmost: 1−1=0. Next: 0−0=0. Next: 1−1=0. Leftmost: 1−0=1. Result: 1000₂ = 8₁₀. Verify: 13₁₀ − 5₁₀ = 8₁₀ ✓. When borrowing through multiple zero positions, the zeros become 1s in a cascade similar to decimal borrowing.

Binary multiplication follows the same algorithm as decimal multiplication. Multiply the multiplicand by each bit of the multiplier, then shift left by the bit's position, then sum all partial products. Since each bit is 0 or 1, each partial product is either 0 or the multiplicand shifted. Example: 101 × 011. 101×1=101, 101×1 shifted 1=1010, 101×0 shifted 2=00000. Sum: 101+1010=1111₂=15₁₀. Verify: 5₁₀ × 3₁₀ = 15₁₀ ✓. All the complexity reduces to shifts and additions.

Hexadecimal (base 16) uses digits 0–9 and A–F (A=10, B=11, C=12, D=13, E=14, F=15). One hex digit represents exactly 4 binary bits (a nibble). Conversion: group binary into 4-bit chunks from the right. 1010 1111₂ → A=1010, F=1111 → AF₁₆. Hex to binary: expand each hex digit to 4 bits. 3C₁₆ → 3=0011, C=1100 → 00111100₂. This is why hex is the standard notation for memory addresses, color codes (#FF5733), and raw data — it compactly represents binary data that would otherwise require long strings of 0s and 1s.

Hexadecimal (base 16) uses digits 0-9 and letters A-F, where A=10, B=11, C=12, D=13, E=14, F=15. Each hex digit represents exactly 4 binary bits, making conversion between binary and hexadecimal direct. Binary 1111 = hex F (decimal 15). Binary 10101100 splits into 1010=A and 1100=C, so hex AC. To convert hex to binary: replace each hex digit with its 4-bit binary equivalent. Hexadecimal is widely used in computing because it compactly represents binary values — a byte (8 bits) fits in exactly two hex digits (00 to FF). For example, the decimal value 255 = binary 11111111 = hex FF.