Understanding Number Bases
A number base (or radix) defines how many unique digits are used to represent numbers in a positional numeral system.
Common Bases:
- Binary (Base 2): Uses digits 0 and 1. Used by computers.
- Octal (Base 8): Uses digits 0-7. Sometimes used in computing.
- Decimal (Base 10): Uses digits 0-9. Standard for human calculations.
- Hexadecimal (Base 16): Uses digits 0-9 and A-F. Common in programming.
Example: The number 42 in decimal equals 101010 in binary, 2A in hexadecimal, and 52 in octal.
Common Number Conversions
Here are some common number conversions across different bases:
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 42 | 101010 | 52 | 2A |
| 255 | 11111111 | 377 | FF |
Extended Bases (32, 36, 58, 62)
- Base 32: Uses
0-9followed byA-V. - Base 36: Uses
0-9followed byA-Zand is case-insensitive on input. - Base 58: Uses
0-9,A-Z, anda-v; it does not remove look-alike characters. - Base 62: Uses
0-9,A-Z, anda-z, with uppercase and lowercase treated as different digits.
These modes are positional number bases built from the shared alphabet 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. Base 32 here is not RFC 4648 Base32, and Base 58 here is not the Bitcoin Base58 alphabet or Base58Check encoding. Use the dedicated encoding tools when you need those formats.