How a number base converter works
A number base (or radix) is simply how many distinct digit symbols a counting system uses before it rolls over to a new column. People count in decimal (base 10) because we have ten fingers. Computers count in binary (base 2) because a transistor is either on or off. Hexadecimal (base 16) and octal (base 8) are compact shorthands that map cleanly onto groups of bits, which is why you see them throughout memory addresses, colour codes and file permissions.
Every base uses positional notation: each digit is multiplied by the base raised to the
power of its position. This tool reads whatever you type, interprets it in its own base, and
re-expresses that same value in the other three — all locally, using JavaScript’s
arbitrary-precision BigInt so large values never lose a single digit.
A worked example: 255
Take the decimal number 255. In binary it is 11111111 — eight ones,
which is exactly one full byte. Reading that positionally: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 =
255. In hexadecimal those eight bits compress neatly into two digits, FF, because
each hex digit covers four bits. In octal it becomes 377, grouping the bits in
threes. One value, four faces.
Common values across all four bases
| Decimal | Hex | Binary | Octal | Why it matters |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | Zero / null in every system |
| 10 | A | 1010 | 12 | Line-feed character in ASCII |
| 16 | 10 | 10000 | 20 | First two-digit hex value |
| 64 | 40 | 1000000 | 100 | Word size boundary in many CPUs |
| 127 | 7F | 1111111 | 177 | Largest signed 8-bit integer |
| 255 | FF | 11111111 | 377 | One full byte; max per RGB channel |
Where each base shows up
Hex for colours & memory
CSS colours like #6650E8 and memory addresses use hex because two digits map to exactly one byte, keeping long values readable.
Octal for Unix permissions
File modes such as chmod 755 use octal: each digit packs the read, write and execute bits for one group of users.
Binary for the hardware
Bit masks, flags and low-level protocols are reasoned about in binary, where each position is a single on/off signal.