How base conversion works
Each positional numeral system represents a number as a sum of powers of its base (2 for binary, 8 for octal, 16 for hexadecimal). Converting from decimal repeatedly divides by the target base and reads the remainders in reverse.
- base — 2 (binary), 8 (octal), or 16 (hexadecimal)
- dᵢ — digit at position i (hex digits A–F represent 10–15)
More detail
Why hexadecimal uses letters
Hexadecimal needs 16 distinct digits, but base-10 only has 10 symbols (0–9), so it borrows A–F for the values 10–15. That's why 255 in decimal becomes FF in hex: F is 15, so FF = 15×16 + 15 = 255.
Quick check. 255 is the maximum value a single byte can hold — it's 11111111 in binary and FF in hex, which is why both show up constantly in colors, IP addresses, and memory sizes.
Frequently asked questions
How do I convert 255 to hexadecimal?
255 ÷ 16 = 15 remainder 15. Both the quotient and remainder are 15, which is F in hex, so 255 = FF. Enter 255 above to confirm — it's the max value a single byte can hold.
How do I convert decimal to binary by hand?
Repeatedly divide by 2 and read the remainders bottom-to-top. For 10: 10÷2=5 r0, 5÷2=2 r1, 2÷2=1 r0, 1÷2=0 r1 → reading remainders upward gives 1010.
Why does hexadecimal use letters A–F?
Hex needs 16 distinct digits per position, but decimal only has 10 symbols (0–9). A–F fill in for 10–15, so a hex digit can represent any value 0–15 with a single character.
What's 1024 in binary and hex?
1024 is 10000000000 in binary (11 digits) and 400 in hex — it's 2¹⁰, which is why it marks the boundary of a kilobyte in computing.