Menu

Denary to Hexadecimal Conversion

Converting Denary to Hexadecimal

Hexadecimal is a base-16 system, so converting a denary number to hex means working out how many sixteens it contains and what is left over. The values you need to convert sit between 0 and 255, so the answer is always one or two hex digits.

Divide by 16

Divide the denary number by 16. The whole-number result is the quotient and what is left over is the remainder. The quotient becomes the left-hand hex digit and the remainder becomes the right-hand hex digit, because in hex the left column counts sixteens and the right column counts ones. Dividing by 10 would give you denary digits instead, and dividing repeatedly by 2 would give you binary digits, so 16 is the number to use.

DenaryQuotient (÷ 16)RemainderHex
155911, written B9B
966060
13013, written DD

Write 10 to 15 as letters

Each hex digit must be a single symbol, so any quotient or remainder from 10 to 15 is written as a letter: A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15. For 155 the remainder is 11, so writing it unconverted would give 911: three characters where a two-digit hex answer has two.

A two-digit answer is two separate digits, never one denary number. 9B is a 9 in the sixteens column and a B in the ones column, so it is nothing like the denary number 91.

Short answers

If the denary number is below 16, the quotient is 0, meaning there are no sixteens, so the answer is just the remainder: 13 becomes D. If the number divides exactly by 16, the remainder is 0, so the right-hand digit is 0 and you keep both digits: 96 is 6 remainder 0, written 60.

Practise this