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:

NotationMeaning
58_denary58 written in base 10
111010_binary111010 written in base 2
3A_hex3A 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 noteCommon 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 baseAlso calledDigit symbolsPlace values
base 10denary or decimal0 to 9powers of 10
base 2binary0, 1powers of 2
base 16hexadecimal0 to 9, A to Fpowers of 16

Hexadecimal uses letters after 9:

Hex digitDenary value
A10
B11
C12
D13
E14
F15

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 1

In 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_denary

In 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_denary

A 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:

DigitPositionPlace valueDigit valueContribution
323
A110
505

So:

3A5_hex = 768 + 160 + 5
        = 933_denary

Digit Value Versus Place Value

Beginners often mix up digit value and place value.

In 2F4_hex:

  • F has digit value 15;
  • F is 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 value32168421
Binary digit110010
Contribution32160020
110010_binary = 32 + 16 + 2
              = 50_denary

A 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_denary

Denary to Binary by Repeated Division

Repeatedly divide by 2. The remainders become the binary digits.

Example: convert 58_denary to binary.

DivisionQuotientRemainder
58 / 2290
29 / 2141
14 / 270
7 / 231
3 / 211
1 / 201

Read the remainders from bottom to top:

58_denary = 111010_binary

Why 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_denary

Denary to Binary by Place Values

Use the largest power of 2 that fits, subtract it, and continue.

Example: convert 58_denary.

Place value32168421
Use it?111010

Trace:

58 - 32 = 26
26 - 16 = 10
10 - 8 = 2
skip 4
2 - 2 = 0
skip 1

So:

58_denary = 111010_binary

This 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_binary

Hexadecimal to Denary

Use powers of 16.

Example: convert 2F4_hex to denary.

Place value256161
Hex digit2F4
Denary digit value2154
Contribution5122404
2F4_hex = 512 + 240 + 4
        = 756_denary

A 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_denary

Denary to Hexadecimal

Repeatedly divide by 16.

Example: convert 756_denary to hexadecimal.

DivisionQuotientRemainderHex digit
756 / 164744
47 / 16215F
2 / 16022

Read the hexadecimal digits from bottom to top:

756_denary = 2F4_hex

This 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_denary

Binary 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 1011

Pad the left group:

0001 0011 1011

Convert each group:

Binary group000100111011
Hex digit13B
100111011_binary = 13B_hex

Why 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_hex

The 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_hex

Hexadecimal 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 digit4-bit binary
60110
C1100
91001
6C9_hex = 011011001001_binary

Leading zeros may be dropped if the question does not require a fixed number of bits:

011011001001_binary = 11011001001_binary

However, if the question asks for a fixed number of bits, keep the leading zeros.

Example:

0F_hex = 00001111_binary

If 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.

ConversionRecommended beginner methodWhy it works well
binary to denaryplace valuesdirectly shows the value of each 1 bit
denary to binaryrepeated division or place valuesboth are standard; repeated division is more systematic
hexadecimal to denaryplace valuessame logic as ordinary denary place value
denary to hexadecimalrepeated division by 16systematic and easy to trace
binary to hexadecimalgroup from the right into four bitsone hex digit maps to four bits
hexadecimal to binaryreplace each hex digit by four bitsdirect 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

MistakeExample of wrong thinkingHow to fix it
Reading remainders top to bottom58_denary = 010111_binaryRead remainders from bottom to top.
Padding binary on the right10110_binary = 10110000_binary before converting to hexAdd leading zeros on the left, not trailing zeros on the right.
Treating F as a variable or letter2F4_hex cannot be calculatedReplace F with digit value 15.
Adding all place values110010_binary = 32 + 16 + 8 + 4 + 2 + 1Add only place values with digit 1.
Confusing representation with valuethinking 10_binary means denary ten10_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, and F as 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

  1. Convert 10101_binary to denary.
  2. Convert 39_denary to binary.
  3. Convert 7D_hex to denary.
  4. Convert 11100110_binary to hexadecimal.
  5. Convert 2B_hex to denary.
  6. Convert 47_denary to hexadecimal.
  7. Convert 101111_binary to hexadecimal.
  8. Convert 3C_hex to binary.
  9. Explain why binary-to-hexadecimal conversion groups bits from the right.
  10. Explain the difference between digit value and place value using 4D_hex as an example.

Answers:

  1. 21_denary.
  2. 100111_binary.
  3. 125_denary.
  4. E6_hex.
  5. 43_denary, because 2B_hex = 2 x 16 + 11.
  6. 2F_hex, because 47 / 16 gives quotient 2 and remainder 15.
  7. 2F_hex, because 101111_binary = 0010 1111_binary.
  8. 00111100_binary. If leading zeros are not required, this may be written as 111100_binary.
  9. Because the rightmost bits are the low-value bits; grouping from the right keeps the place values aligned correctly.
  10. In 4D_hex, D has digit value 13. Since it is in the ones place, it contributes 13. The 4 has digit value 4, but it is in the 16s place, so it contributes 4 x 16 = 64.