# Hexadecimal Number

0x1111 → 0001 0001 0001 0001 in binary

Ah, so essentially, each position in the hex is represented by 4 digits in binary.

so 16 digits in binary is represented by 4 digits in hexadecimal.

### Conversion

To convert from Hex (16) to Binary, just do the groupings of 4.

Binary to Hex is as simple as taking every four digit and converting that to its hex value. It also works in Octal Number

Other Example:

- A → 1010
- F → 1111
- 6 → 0110

Therefore, AF6 = “101011110110” in binary Ex:

|Decimal (Base 10) |Binary (Base 2) |Hexadecimal (Base 16) | | :---: | :---: | :---: | :---: | |0 | 00000011 |0x0| | 1 | 00000001 | 0x1 | | 2 | 00000010| 0x2 | | 3 | 00000011| 0x3 | | 4 | 00000100 | 0x4 | | 5 | 00000101 | 0x5 | | 6 | 00000110 | 0x6 | | 7 | 00000111 | 0x7 | | 8 | 00001000| 0x8 | | | 9 | 00001001| 0x9 | | | 10 | 00001010| 0xA | | | 11 | 00001011| 0xB | | 12 | 00001100| 0xC | | 13 | 00001101 | 0xD | | 14 | 00001110 | 0xE | | 15| 00001111 | 0xF |