Number Base Conversion Practice
Practice converting numbers between binary, octal, decimal, and hexadecimal. Pick which two bases to convert between, then check your work with a full step-by-step explanation.
Computers store everything in binary, but people read hex, octal, and decimal instead — so converting between bases by hand is one of those skills that comes up constantly in intro programming and computer organization courses. Pick which two bases you want to practice below and start converting. Prefer working from paper instead of a screen, or need a set of problems to hand out to a whole class? This base conversion worksheet generator builds a printable version of the same kind of problem.
Base Conversion Practice
Choose which two bases to convert between and a difficulty, then convert the value shown and click Check Answer.
What are number bases?
Every number system works the same way: each digit's position represents a power of the base, and the digit tells you how many of that power to add in. In decimal (base 10), the number present in the "hundreds" place is multiplied by 102. In binary (base 2), a digit two places from the right is multiplied by 22. Hex (base 16) and octal (base 8) work identically, just with a bigger or smaller set of digits to choose from at each position.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Converting decimal to another base: repeated division
To convert a decimal number into binary, octal, or hex, divide repeatedly by the target base and keep track of the remainders. Once the quotient hits 0, read the remainders from the bottom of your work back up to the top.
Example: convert 202 to hex. Divide by 16 each time: 202 ÷ 16 = 12 remainder 10 (A), then 12 ÷ 16 = 0 remainder 12 (C). Reading bottom to top gives CA.
Converting another base to decimal: positional expansion
To convert the other direction, multiply each digit by its place value (a power of the base it's written in) and add the results together.
Example: convert hex CA to decimal. C is 12 and A is 10, so (12 × 16<sup>1</sup>) + (10 × 16<sup>0</sup>) = 192 + 10 = 202.
Converting directly between binary, octal, and hex
Binary, octal, and hex are all powers of two (21, 23, 24), so you can convert between any two of them without ever touching decimal — just regroup the bits. Expand each digit of the source number into its fixed-width binary chunk (1 bit for binary itself, 3 bits for octal, 4 bits for hex), concatenate all the chunks, then split that binary string into the target base's chunk width (padding with leading zeros on the left if needed) and convert each chunk back to a digit.
Example: convert octal 754 to hex. Expand each octal digit to 3 bits: 7 → 111, 5 → 101, 4 → 100, giving the binary string 111101100. Pad it to a multiple of 4 bits: 000111101100. Split into 4-bit groups: 0001 1110 1100, which convert to 1, E, C — so the answer is 1EC.
Common mistakes to watch for
- Forgetting to pad with leading zeros before grouping. Every digit needs its full fixed width (3 bits for octal, 4 for hex) before you concatenate, or the grouping shifts and the whole answer comes out wrong.
- Reading division remainders top to bottom instead of bottom to top. The first remainder you calculate is the last digit of the answer.
- Mixing up hex letters and their values.
AthroughFare 10 through 15 — it's easy to be off by one under time pressure. - Dropping a leading zero that actually matters.
0111and111represent the same value, but when you're mid-conversion and grouping bits, a missing zero shifts every group after it.
Once you're comfortable converting by hand, the number base converter is useful for checking your work instantly across all four bases at once.