Binary Converter
Convert binary numbers to decimal, hexadecimal, and octal simultaneously or Decimal to Binary.
How Binary Numbers Work
Binary (base-2) is the number system that underpins all digital computing. It uses only two digits — 0 and 1 — called bits. Each position in a binary number represents a power of 2, just as each position in a decimal number represents a power of 10. The rightmost bit is 2⁰ (1), the next is 2¹ (2), then 2² (4), 2³ (8), and so on. A group of 8 bits is called a byte and can represent values from 0 (00000000) to 255 (11111111).
Binary Conversion Formulas
Binary to Decimal: Decimal = dₙ×2ⁿ + dₙ₋₁×2ⁿ⁻¹ + ... + d₁×2¹ + d₀×2⁰. Binary to Hexadecimal: Group binary digits into sets of 4 from right to left, then convert each group (0000=0, 0001=1, ..., 1010=A, ..., 1111=F). Binary to Octal: Group binary digits into sets of 3 from right to left, then convert each group (000=0, 001=1, ..., 111=7). Pad with leading zeros if the leftmost group is incomplete.
Worked Example: Convert 11111111 (Binary)
To Decimal: 1×2⁷ + 1×2⁶ + 1×2⁵ + 1×2⁴ + 1×2³ + 1×2² + 1×2¹ + 1×2⁰ = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. To Hexadecimal: Split into groups of 4: 1111 1111 → F F → FF. To Octal: Split into groups of 3: 11 111 111 → pad to 011 111 111 → 3 7 7 → 377. So 11111111₂ = 255₁₀ = FF₁₆ = 377₈.
Binary Conversion Reference Table
0000 = 0 = 0x0 · 0001 = 1 = 0x1 · 0010 = 2 = 0x2 · 0011 = 3 = 0x3 · 0100 = 4 = 0x4 · 0101 = 5 = 0x5 · 0110 = 6 = 0x6 · 0111 = 7 = 0x7 · 1000 = 8 = 0x8 · 1001 = 9 = 0x9 · 1010 = 10 = 0xA · 1011 = 11 = 0xB · 1100 = 12 = 0xC · 1101 = 13 = 0xD · 1110 = 14 = 0xE · 1111 = 15 = 0xF. Key byte values: 10000000 = 128, 11000000 = 192, 11111111 = 255.
Technical Details
This converter accepts any valid binary string (digits 0 and 1 only, spaces allowed for readability) and simultaneously outputs the decimal, hexadecimal, and octal equivalents. Binary is the native language of CPUs — every instruction, memory address, and data value is ultimately stored as binary. Common bit widths: 8-bit (byte, 0–255), 16-bit (0–65,535), 32-bit (0–4,294,967,295), and 64-bit (0–18,446,744,073,709,551,615). JavaScript uses 64-bit IEEE 754 floating-point internally, so this tool accurately handles integers up to 2⁵³ − 1 (9,007,199,254,740,991).
Frequently Asked Questions
What is 11111111 in decimal? 11111111₂ = 255₁₀. This is the maximum value of a single byte. How do I convert binary to hex quickly? Group the binary digits into sets of 4 from the right and convert each group: 1010 = A, 1111 = F, 0011 = 3, etc. What is the largest binary number this tool handles? It handles integers up to JavaScript's safe integer limit of 2⁵³ − 1, which is a 53-bit binary number. Why is binary important? All digital computers process data in binary because electronic circuits have two stable states (on/off, high/low voltage), which map directly to 1 and 0.
Solved Examples
Example 1: A network engineer sees the subnet mask 11000000. What is this in decimal? 1×2⁷ + 1×2⁶ + 0+0+0+0+0+0 = 128 + 64 = 192. Answer: 192. Example 2: Convert the binary IP address octet 10101100 to decimal and hex. Decimal: 128+0+32+0+8+4+0+0 = 172. Hex: 1010 1100 → A C → AC. Answer: 172 decimal, AC hex. Example 3: A programmer writes the binary flag 00101010. What decimal value is this? 0+0+32+0+8+0+2+0 = 42. Answer: 42 (the "Answer to the Ultimate Question" in computing culture). Example 4: Convert 1111 0000 to all formats. Decimal: 128+64+32+16 = 240. Hex: F0. Octal: 011 110 000 → 360. Answer: 240₁₀ = F0₁₆ = 360₈.
Practice Questions
1. Convert 10110 to decimal. (Answer: 22) 2. What is 11001100 in hexadecimal? (Answer: CC) 3. Convert 101010 to octal. (Answer: 52) 4. What is 10000000 in decimal? (Answer: 128) 5. Convert binary 1111 1110 to decimal and hex. (Answer: 254, FE) 6. What binary number represents decimal 100? (Answer: 1100100)
Common Mistakes to Avoid
The most frequent error when converting binary to decimal is miscounting the powers of 2. Remember: positions are numbered from RIGHT to LEFT starting at 0 (not 1). So the rightmost bit is 2⁰=1, not 2¹=2. Another common mistake is forgetting to pad when grouping for hex or octal conversion — if you have 5 bits like 11010, pad to 8 bits (00011010) before grouping into fours (0001 1010 = 1A). Students also sometimes read binary right-to-left out of habit from decimal, but binary numbers are read left-to-right just like decimal. Finally, when entering binary numbers with spaces for readability (1111 0000), make sure the spaces don't split a meaningful group incorrectly.
Key Takeaways
Binary uses only 0 and 1, with each position representing a doubling power of 2. One byte = 8 bits = values 0 to 255. Binary to hex: group 4 bits per hex digit (this is exact, not an approximation). Binary to octal: group 3 bits per octal digit. Memorize key powers of 2: 2⁰=1, 2¹=2, 2²=4, 2³=8, 2⁴=16, 2⁵=32, 2⁶=64, 2⁷=128, 2⁸=256. All data in a computer — text, images, music, video — is stored as binary. Understanding binary is foundational to programming, networking, and computer engineering.