Binary to Decimal Converter
Convert numbers between binary, octal, decimal, and hexadecimal — with a place-value breakdown that shows exactly how the conversion works.
Frequently Asked Questions
How do you convert binary to decimal?
Multiply each binary digit by 2 raised to the power of its position (counting from 0 on the right), then sum the results. Example: 1011₂ = (1×2³) + (0×2²) + (1×2¹) + (1×2⁰) = 8 + 0 + 2 + 1 = 11₁₀. The leftmost bit has the highest power (most significant bit); the rightmost has power 0 (least significant bit). An 8-bit binary number can represent 0–255 (2⁸ − 1 = 255).
How do you convert decimal to binary?
Repeatedly divide the decimal number by 2 and record the remainders. Read the remainders bottom-to-top. Example: 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 r0; 3 ÷ 2 = 1 r1; 1 ÷ 2 = 0 r1. Reading remainders upward: 1101₂. Verify: 8+4+0+1 = 13 ✓. For quick powers-of-2 reference: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024.
Why do computers use binary instead of decimal?
Computer transistors have two reliable physical states — fully on (1) and fully off (0). Binary maps perfectly onto this: a high voltage signal = 1, low = 0. Trying to use 10 states (decimal) would require precise voltage levels that are unreliable at the nanosecond switching speeds of modern CPUs (3–5 GHz). Binary also makes logic operations (AND, OR, NOT, XOR) trivially implementable in hardware. The entire digital world — text, images, video, code — ultimately encodes as sequences of 1s and 0s.
What is hexadecimal and why is it used in programming?
Hexadecimal (base 16) uses digits 0–9 plus A–F (A=10, B=11, C=12, D=13, E=14, F=15). One hex digit represents exactly 4 binary bits, so two hex digits represent a full byte (8 bits). This makes hex a compact, human-readable shorthand for binary. Common uses: memory addresses (0x7FFE4A), HTML/CSS colors (#3B82F6), machine code, error codes, and network MAC addresses. The prefix "0x" (code) or "#" (colors) indicates hexadecimal.
What is octal and where is it used?
Octal (base 8) uses digits 0–7. Each octal digit represents 3 binary bits. Example: 173₈ = 001 111 011₂ = 123₁₀. Octal was historically used on older computers (e.g. PDP series) that grouped bits in threes. It is still used today for Unix/Linux file permissions — the "chmod 755" command uses octal (7=111 = rwx; 5=101 = r-x; 4=100 = r--). Modern programming more commonly uses hexadecimal, but octal remains standard in the Linux/Unix world for permissions.