Number Base Converter
Convert between decimal, binary, octal, and hexadecimal. See Roman numerals and scientific notation too.
What Are Number Bases?
A number base (or radix) determines how many unique digits are used to represent numbers. Decimal (base-10) is the system we use every day, with digits 0 through 9. Binary (base-2) uses only 0 and 1, and is the foundation of all digital computing β every piece of data in your computer is ultimately stored as binary.
Octal (base-8) uses digits 0-7 and was historically used in early computing systems. It's still used in Unix file permissions (e.g., chmod 755). Hexadecimal (base-16) uses digits 0-9 plus letters A-F, and is everywhere in modern computing β from color codes (#FF5733) to memory addresses and MAC addresses.
How Binary Works
In binary, each position represents a power of 2 (just as each decimal position represents a power of 10). The rightmost bit is 20 = 1, the next is 21 = 2, then 22 = 4, and so on. For example, the binary number 101010 equals 32 + 8 + 2 = 42 in decimal.
Computers use binary because digital circuits have two states: on (1) and off (0). Every image, sound, video, and piece of text you interact with on a computer is ultimately represented as a long sequence of ones and zeros.
Common Conversions Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 42 | 101010 | 52 | 2A |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
Hexadecimal in Computing
Hexadecimal is popular in computing because it provides a human-friendly way to represent binary data. Each hex digit corresponds to exactly 4 binary bits (a "nibble"), so a single byte (8 bits) is always represented by exactly two hex digits. This makes hex ideal for displaying memory addresses, color values, character encodings, and raw data dumps.
In web development, colors are commonly specified in hex format: #RRGGBB, where each pair represents the red, green, and blue channel intensity from 00 (0) to FF (255). Programming languages typically prefix hex numbers with 0x (e.g., 0xFF = 255).