A gentle introduction to * hexadecimal *(base 16).

Table of Contents |
---|

### Decimal numbers

In our standard * decimal *system each

*(which can be 0,1,2,3,4,5,6,7,8,9) in a number represents a*

**digit***in that place:*

**power of ten**### Hexadecimal numbers

The * hexidecimal *(base 16) system is similar, except that each

*represents a*

**digit***in that place.*

**power of 16**...

To convert a decimal number to hex, you remove multiples of those powers of 16 as shown below.

### Binary numbers

In the * binary* (base 2) system, each

*is a*

**digit***, and the digits are just*

**power of two****0**and

**1**.

It's easy to translate a hexadecimal number into binary because you can decompose each hex digit into its 4 bits.

The benefit of using hexadecimal instead of * binary*, is that it hex is much shorter to write, but still lets us easily determine the value of specific bits:.

### Octal numbers

Another popular base in the computer world is * octal *– (base 8) where each digit is a

*, and digits are 0, 1, 2, 3, 4, 5, 6, 7.*

**power of 8**Octal is more compact than binary, but less compact than either decimal or hexadecimal.