On Paper: Binary and Hexadecimal Numbers Explained - Why Hex is so Compatible with Binary

It all comes down to the digits. Binary digits consists of either a 1 or a 0 (base 2 as opposed to our decimal system of 0-9 as base 10). A 4-bit binary number is 4 digits of 0s and 1s. Each digit of hexadecimal is 0-15, or base 16. Counting in binary (4-bit): 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111. That's 16 different possibilities. That's why hexadecimal is compatible with binary, because you can represent a 4-bit binary number with a single digit hexadecimal number. Counting in hexadecimal, letters are used for the numbers above 9 to keep the digit in one space. Counting to 16 is: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. One 8-bit binary number would be a two digit hexadecimal number. In decimal, the two digit hex number or 8-bit binary number would be 255 in decimal. In hex, the max would be FF. FF in Hex = 11111111 in binary = 255 in decimal. A good example of where you may have seen hex would be with color. In most cases in operating systems, colors are represented like: #FEFFA9. If you split this up into pairs, you have red, green blue: red-FE green-FF blue-A9.



Back to blog

Leave a comment

Please note, comments need to be approved before they are published.