Denary to Hexadecimal
Convert denary to hexadecimal:
Hexadecimal is base 16, this means there are 16 digits: 0-9 and A-F. You can see the table adjacent what each hexadecimal digit is equivalent to.
1x 2x 3x 4x 5x 6x 7x 8x 9x 10x
16 32 48 64 80 96 112 128 144 160
Example conversion
Convert the denary number 93 to hexadecimal:
16 1 D is 13
5 D (5 * 16) + (D * 1)
(5 * 16) + (13 * 1) = 93
Hex Den Bin
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111The hexadecimal number system uses column headings of 1 and 16, multiplying by 16 each time as the number system is base 16. You only need to know 2 digit hexadecimal numbers for GCSE.
Overview
There are a few ways to convert a denary number into hexadecimal. Using / 16 and % or MOD, or converting to binary and then for each nibble write the equivalent hexadecimal digit.
As hexadecimal is base 16, that means there are 16 different digits and we need to use more than just 0-9 from denary. Therefore A-F are introduced. As you can see in the table below, each hexadecimal digit is equivalent to a binary nibble.
Hex Den Bin
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111 References:
- BBC Bitesize GCSE: AQA, OCR, Edexcel
- Wikibooks Computer Science A level (hexadecimal): OCR
- YouTube - How To Convert Decimal to Hexadecimal (TheOrganicChemistryTutor)