Hexadecimal numbers are a number system in base-16. Numbers range from 0-9 and a-f.

What makes them useful (and octal numbers) is an easy conversion from binary numbers. We can group every four digits together and transform into their hexadecimal equivalent. Since modern computers often have 32-bit or 64-bit systems, binary numbers can get super long and we instead use octal or hexadecimal numbers to shorten them.

Conversion

To convert to binary, we can take each digit and find its 4-digit binary equivalent. This is fairly easy. To convert from binary to hex, we can work from the least significant bit, take groups of 4 and move to the left. At our leftmost group, we can add leading 0s to the left until we get a full group of 4.

To convert from base-10, we can divide the decimal number by 16 and successively take the remainder. To convert to base-10, we can multiply like the example below: