Number Bases and Manual Conversion
You can read this note directly if you know ordinary base-10 numbers. A number base tells you how many digit symbols are available before the next place value is needed.
The main idea is simple:
A number is not just a row of digits. Each digit has a value because of its position.
This is why the digit 1 means different things in 10, 100, and 1000. The same idea works in denary, binary, and hexadecimal.
How to Read the Notation
These notes use suffix words to avoid ambiguity:
| Notation | Meaning |
|---|---|
58_denary | 58 written in base 10 |
111010_binary | 111010 written in base 2 |
3A_hex | 3A written in base 16 |
The suffix is a label, not a digit. For example, 111010_binary contains six binary digits: 1, 1, 1, 0, 1, 0.
Some textbooks use small base subscripts instead:
| This note | Common textbook notation |
|---|---|
58_denary | |
111010_binary | |
3A_hex |
Both notations mean the same thing. The suffix notation is used here because it is easier to read in plain text.
Three Number Bases
A base tells us how many digit symbols are available.
| Number base | Also called | Digit symbols | Place values |
|---|---|---|---|
| base 10 | denary or decimal | 0 to 9 | powers of 10 |
| base 2 | binary | 0, 1 | powers of 2 |
| base 16 | hexadecimal | 0 to 9, A to F | powers of 16 |
Hexadecimal uses letters after 9:
| Hex digit | Denary value |
|---|---|
A | 10 |
B | 11 |
C | 12 |
D | 13 |
E | 14 |
F | 15 |
Important: in a hexadecimal number such as 3A5_hex, A means the digit value 10. It is not the character A as text.
Place Value
In denary, each place is a power of 10:
482 = 4 x 100 + 8 x 10 + 2 x 1In binary, each place is a power of 2:
101101_binary = 1 x 32 + 0 x 16 + 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1
= 45_denaryIn hexadecimal, each place is a power of 16:
Caption: Hexadecimal uses base-16 place values and digit values from 0 to 15.
Example:
3A5_hex = 3 x 256 + 10 x 16 + 5 x 1
= 933_denaryA means 10, not the letter A as text.
The same place-value idea works in every base:
The rightmost digit is at position 0. The next digit to the left is at position 1, and so on.
For example, in 3A5_hex:
| Digit | Position | Place value | Digit value | Contribution |
|---|---|---|---|---|
3 | 2 | 3 | ||
A | 1 | 10 | ||
5 | 0 | 5 |
So:
3A5_hex = 768 + 160 + 5
= 933_denaryDigit Value Versus Place Value
Beginners often mix up digit value and place value.
In 2F4_hex:
Fhas digit value 15;Fis in the 16s place;- its contribution is
15 x 16 = 240.
So F does not simply contribute 15 to the final value. It contributes 15 groups of 16.
The same idea applies in denary. In 482, the digit 8 has digit value 8, but because it is in the tens place, it contributes 8 x 10 = 80.
Binary to Denary
Use the place values for powers of 2.
Begin from the right. The rightmost digit is worth 1, then 2, then 4, then 8, and so on.
Example: convert 110010_binary to denary.
| Place value | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|
| Binary digit | 1 | 1 | 0 | 0 | 1 | 0 |
| Contribution | 32 | 16 | 0 | 0 | 2 | 0 |
110010_binary = 32 + 16 + 2
= 50_denaryA fast way to check the answer: 110010_binary has six bits, so its value must be less than . The answer 50_denary is possible.
Try this before reading on:
Convert 10101_binary to denary.Answer:
10101_binary = 16 + 4 + 1
= 21_denaryDenary to Binary by Repeated Division
Repeatedly divide by 2. The remainders become the binary digits.
Example: convert 58_denary to binary.
| Division | Quotient | Remainder |
|---|---|---|
58 / 2 | 29 | 0 |
29 / 2 | 14 | 1 |
14 / 2 | 7 | 0 |
7 / 2 | 3 | 1 |
3 / 2 | 1 | 1 |
1 / 2 | 0 | 1 |
Read the remainders from bottom to top:
58_denary = 111010_binaryWhy bottom to top? The first remainder is the ones bit. The last remainder is the highest place-value bit.
Caption: The remainder column is read from bottom to top because the first remainder is the lowest-value bit and the last remainder is the highest-value bit.
Self-check by converting back:
111010_binary = 32 + 16 + 8 + 2
= 58_denaryDenary to Binary by Place Values
Use the largest power of 2 that fits, subtract it, and continue.
Example: convert 58_denary.
| Place value | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|
| Use it? | 1 | 1 | 1 | 0 | 1 | 0 |
Trace:
58 - 32 = 26
26 - 16 = 10
10 - 8 = 2
skip 4
2 - 2 = 0
skip 1So:
58_denary = 111010_binaryThis method is useful when the number is small and you can see the powers of 2 quickly.
Try this before reading on:
Convert 39_denary to binary.Answer:
39 - 32 = 7
skip 16
skip 8
7 - 4 = 3
3 - 2 = 1
1 - 1 = 0
39_denary = 100111_binaryHexadecimal to Denary
Use powers of 16.
Example: convert 2F4_hex to denary.
| Place value | 256 | 16 | 1 |
|---|---|---|---|
| Hex digit | 2 | F | 4 |
| Denary digit value | 2 | 15 | 4 |
| Contribution | 512 | 240 | 4 |
2F4_hex = 512 + 240 + 4
= 756_denaryA useful habit is to convert each hexadecimal digit to its denary digit value before multiplying by the place value.
Try this before reading on:
Convert 7D_hex to denary.Answer:
7D_hex = 7 x 16 + 13 x 1
= 112 + 13
= 125_denaryDenary to Hexadecimal
Repeatedly divide by 16.
Example: convert 756_denary to hexadecimal.
| Division | Quotient | Remainder | Hex digit |
|---|---|---|---|
756 / 16 | 47 | 4 | 4 |
47 / 16 | 2 | 15 | F |
2 / 16 | 0 | 2 | 2 |
Read the hexadecimal digits from bottom to top:
756_denary = 2F4_hexThis is the same idea as denary-to-binary conversion. The only difference is that the divisor is 16, and remainders from 10 to 15 must be written as A to F.
Self-check by converting back:
2F4_hex = 2 x 256 + 15 x 16 + 4
= 512 + 240 + 4
= 756_denaryBinary to Hexadecimal
One hexadecimal digit represents four binary bits.
Caption: Group from the right so that the low-value bits stay in the correct group.
Example: convert 100111011_binary to hexadecimal.
Group from the right:
1 0011 1011Pad the left group:
0001 0011 1011Convert each group:
| Binary group | 0001 | 0011 | 1011 |
|---|---|---|---|
| Hex digit | 1 | 3 | B |
100111011_binary = 13B_hexWhy group from the right? The rightmost bits are the low-value bits. If you group from the left, the place values shift and the answer can become wrong.
Another example:
10110_binary
= 0001 0110_binary
= 16_hexThe leading zeros are added on the left only to complete the leftmost group of four bits. They do not change the value.
Self-check: one hexadecimal digit represents four binary bits, so the hexadecimal answer should be much shorter than the binary input.
Try this before reading on:
Convert 11100110_binary to hexadecimal.Answer:
1110 0110_binary = E6_hexHexadecimal to Binary
Replace each hexadecimal digit with four bits.
This is often easier than going through denary, because each hexadecimal digit has a fixed 4-bit pattern.
Example:
| Hex digit | 4-bit binary |
|---|---|
6 | 0110 |
C | 1100 |
9 | 1001 |
6C9_hex = 011011001001_binaryLeading zeros may be dropped if the question does not require a fixed number of bits:
011011001001_binary = 11011001001_binaryHowever, if the question asks for a fixed number of bits, keep the leading zeros.
Example:
0F_hex = 00001111_binaryIf the question asks for an 8-bit answer, 00001111_binary is better than 1111_binary.
Choosing a Conversion Method
Different methods are useful in different situations.
| Conversion | Recommended beginner method | Why it works well |
|---|---|---|
| binary to denary | place values | directly shows the value of each 1 bit |
| denary to binary | repeated division or place values | both are standard; repeated division is more systematic |
| hexadecimal to denary | place values | same logic as ordinary denary place value |
| denary to hexadecimal | repeated division by 16 | systematic and easy to trace |
| binary to hexadecimal | group from the right into four bits | one hex digit maps to four bits |
| hexadecimal to binary | replace each hex digit by four bits | direct mapping, no arithmetic needed |
For programming, it is often convenient to convert through denary using helper functions. For manual exam questions, direct grouping is usually faster for binary-hexadecimal conversion.
Common Wrong Answer Diagnosis
| Mistake | Example of wrong thinking | How to fix it |
|---|---|---|
| Reading remainders top to bottom | 58_denary = 010111_binary | Read remainders from bottom to top. |
| Padding binary on the right | 10110_binary = 10110000_binary before converting to hex | Add leading zeros on the left, not trailing zeros on the right. |
Treating F as a variable or letter | 2F4_hex cannot be calculated | Replace F with digit value 15. |
| Adding all place values | 110010_binary = 32 + 16 + 8 + 4 + 2 + 1 | Add only place values with digit 1. |
| Confusing representation with value | thinking 10_binary means denary ten | 10_binary = 2_denary. The suffix matters. |
Common Mistakes
- Adding all place values instead of only the ones with digit
1. - Treating
A,B,C,D,E, andFas denary digits instead of values 10 to 15. - Reading repeated-division remainders in the wrong direction.
- Forgetting that each hexadecimal digit maps to exactly four bits.
- Padding zeros on the right instead of the left when converting binary to hexadecimal.
- Dropping leading zeros when the question asks for a fixed number of bits.
- Forgetting that the base label is not part of the number.
Check Your Understanding
- Convert
10101_binaryto denary. - Convert
39_denaryto binary. - Convert
7D_hexto denary. - Convert
11100110_binaryto hexadecimal. - Convert
2B_hexto denary. - Convert
47_denaryto hexadecimal. - Convert
101111_binaryto hexadecimal. - Convert
3C_hexto binary. - Explain why binary-to-hexadecimal conversion groups bits from the right.
- Explain the difference between digit value and place value using
4D_hexas an example.
Answers:
21_denary.100111_binary.125_denary.E6_hex.43_denary, because2B_hex = 2 x 16 + 11.2F_hex, because47 / 16gives quotient 2 and remainder 15.2F_hex, because101111_binary = 0010 1111_binary.00111100_binary. If leading zeros are not required, this may be written as111100_binary.- Because the rightmost bits are the low-value bits; grouping from the right keeps the place values aligned correctly.
- In
4D_hex,Dhas digit value 13. Since it is in the ones place, it contributes 13. The4has digit value 4, but it is in the 16s place, so it contributes4 x 16 = 64.