Each binary digit is a power of two, counted from the right starting at 20. Add up the powers where the digit is 1. For example 1101 = 8 + 4 + 0 + 1 = 13. To go from decimal to binary, divide by 2 repeatedly and read the remainders from bottom to top.
| Decimal | Binary | Hex | Octal |
|---|
1010 in binary is 8 + 2 = 10 in decimal.
255 is 11111111 in binary (eight ones), FF in hex and 377 in octal.
Digital circuits have two stable states, on and off, so every value is stored as a string of 0s and 1s. Hex is a compact way to write binary: each hex digit stands for exactly four bits.
See also: Roman Numeral Converter · Unix Timestamp Converter · Base64 Encoder