Menu

Hexadecimal to Denary Conversion

Converting Hexadecimal to Denary via Binary

You can turn a two-digit hexadecimal number into denary by going through binary. Split the hexadecimal number into its two digits, change each digit into a 4-bit nibble, join the nibbles into 8 bits, then add up the column headings wherever a 1 appears.

Changing each digit into a nibble

Each hexadecimal digit stands for one nibble, so it has a fixed 4-bit pattern built from the nibble column headings 8, 4, 2 and 1. Digits 0 to 9 use their usual value; letters A to F mean 10 to 15. For example, 2 is 0010, while A means 10, which is 8 + 2, giving 1010.

Joining the nibbles

The nibbles are placed side by side in the order they appear. The left digit supplies the left four bits and the right digit supplies the right four bits, so the nibbles are not added together. Take 2A: 2 is 0010 and A (10, which is 8 + 2) is 1010, so together they make 00101010.

Adding the column headings

Now read the 8 bits against the column headings 128, 64, 32, 16, 8, 4, 2 and 1, and add only the columns holding a 1. For 00101010 the 1s sit in the 32, 8 and 2 columns, so the denary value is 32 + 8 + 2 = 42.

  • 0010 1010 is one byte, so every two-digit hexadecimal number gives a denary value from 0 to 255.
  • Because each nibble is fixed, the same two digits always produce the same denary value.

The point of the route through binary is that it shows how the hexadecimal digits build up one byte: each nibble is a small binary number, and joining them lines up all eight columns.

Hexadecimal digitDenary value4-bit nibble
440100
991001
A101010
D131101
F151111

The place-value method on the same number gives 42 too, so the two routes agree.

Practise this

OCR GCSE Computer Science · Hexadecimal to Denary Conversion