Binary and Hexadecimal Explained: Converting Number Bases
On this page
Every number system uses place value. In decimal each place is a power of 10; in binary each place is a power of 2 and the only digits are 0 and 1; in hexadecimal each place is a power of 16, with digits 0–9 and A–F. Convert to decimal by multiplying out place values, and from decimal by repeated division.
Place value in binary
means
Decimal to binary: repeated division
Divide by 2 repeatedly and write down the remainders, then read them bottom to top.
r 1, r 0, r 1, r 1, so .
For a bigger example, .
Hexadecimal
Hex digits: 0–9 then A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
, the largest value in one byte.
Binary ↔ hex shortcut
Each hex digit is exactly four binary digits. Group binary digits in fours from the right:
, so .
Common mistakes
- Reading the division remainders top to bottom instead of bottom to top.
- Forgetting that A–F stand for 10–15.
- Grouping binary digits from the left instead of the right.
Practice questions
- Convert to decimal.
- Convert 37 to binary.
- Convert to decimal.
Answers: 1) 19 2) 3) 31
Convert between any bases from 2 to 36 with the binary converter, which shows both methods. Powers of 2 come from the exponents calculator, and division with remainders from the remainder calculator.
Frequently asked questions
Why do computers use binary?
Electronic circuits have two reliable states, on and off, which map naturally to 1 and 0.
What is a byte?
Eight bits, which can store 256 different values (0 to 255).
What is octal?
Base 8, using digits 0–7. Each octal digit is three binary digits.
#number#binary#computing
