Binary to Decimal Converter
Convert numbers between binary, octal, decimal, and hexadecimal — with a place-value breakdown that shows exactly how the conversion works.
Convert numbers between binary, octal, decimal, and hexadecimal — with a place-value breakdown that shows exactly how the conversion works.
Convert between binary and decimal while learning how computers actually store numbers.
Subnet masks and IP addressing make far more sense when you can flip octets to binary instantly.
Practice conversions until they're second nature — then verify with the calculator.
Decode permission bits, status registers, and bitmasks without hand-counting powers of two.
Six weights of 1, 2, 4, 8, 16 and 32 units can measure anything up to 63. That is binary made physical, and it is why the set in an old chemist's scale looks like it does.
Storage is sold in powers of ten but addressed in powers of two. The 7% that appears to go missing is the gap between 10⁹ and 2³⁰.
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).
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.
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.
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.
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.