Skip to content

binary numbers

0 and 1 Is base 2 so:

0 0 0 0
1 1 1 1
24 22 21 20

Binary numbers are from right to left:
0001 = 1
1001 = 9 etc.

The amount of values is: 2N - 1

1 byte has 8 bits which is a maximum of 255 values. Note that IP addresses are 8 bits for each segment !

Often the binary is written has Hexadecimal, which has 16 characters so is shorter than large binary numbers and easier to read.

In SQL, binary(16) refers to 16 byte string length with padding of 0x00 to keep length the same.