What this converter does
This tool converts a whole number between the four most common number systems in computing: binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Enter any value, tell the calculator which base it is written in, and it returns the equivalent representation in all four systems at once.
How to use it
Type your number in the value box, choose its source base from the drop-down, then read the results. For hexadecimal you may use the digits 0-9 and letters A-F (case does not matter), and an optional 0x or 0b prefix is stripped automatically. If a digit is invalid for the chosen base, the result falls back to zero.
The formula explained
To read a number into decimal, each digit is multiplied by the base raised to its position (counting from 0 on the right) and the products are summed: $$\text{value} = \sum_{i=0}^{k-1} d_i \cdot \text{base}^{\,i}$$ To go the other way, the decimal value is repeatedly divided by the target base; each remainder is a digit, and reading the remainders from last to first gives the converted number.
Worked example
Take binary 1111. In decimal that is $$1\times2^3 + 1\times2^2 + 1\times2^1 + 1\times2^0 = 8 + 4 + 2 + 1 = 15$$ Converting 15 to hexadecimal: \(15 \div 16 = 0\) remainder 15, and 15 maps to the digit F. In octal, \(15 \div 8 = 1\) remainder 7, so it is 17.
Common Number-System Equivalents
The four positional number systems used in computing share the same values — only the base (radix) differs. Decimal (base 10) is the everyday system; binary (base 2) is how data is physically stored; octal (base 8) and hexadecimal (base 16) are compact shorthands for grouping bits. The table below lines up the most frequently encountered values across all four systems.
| Decimal (base 10) | Binary (base 2) | Octal (base 8) | Hex (base 16) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
Note how 255 (the largest value an 8-bit byte can hold) is eight 1s in binary and FF in hex, while 256 needs a ninth bit. These boundary values appear constantly in colors, memory sizes and network masks.
Key Terms Explained
- Base / Radix
- The number of distinct digit symbols a system uses, and the value each position is multiplied by as you move left. Decimal has base 10 (digits 0–9), binary base 2 (0–1), octal base 8 (0–7) and hexadecimal base 16 (0–9 then A–F). A digit \(d_i\) in position \(i\) contributes \(d_i \cdot \text{base}^{\,i}\) to the total.
- Bit
- A binary digit — the smallest unit of data, holding a single 0 or 1. \(n\) bits can represent \(2^n\) distinct values.
- Nibble
- A group of 4 bits. A nibble holds \(2^4 = 16\) values, which is exactly one hexadecimal digit (0–F). This is why hex maps so neatly onto binary — each hex digit is one nibble.
- Byte
-
A group of 8 bits (two nibbles), representing \(2^8 = 256\) values, from 0 to 255. A byte is written as two hex digits, e.g.
FF= 255. - Most Significant Digit (MSD)
- The leftmost digit, carrying the greatest positional weight (the highest power of the base). In binary it is the most significant bit (MSB).
- Least Significant Digit (LSD)
- The rightmost digit, with the smallest weight (\(\text{base}^0 = 1\)). In binary it is the least significant bit (LSB) and determines whether a value is odd or even.
- 0b prefix
-
A convention (used in C, Python and others) marking a literal as binary, e.g.
0b1010means decimal 10. The0bis notation only, not part of the value. - 0x prefix
-
The standard marker for a hexadecimal literal, e.g.
0xFFmeans decimal 255. Octal is often shown with a leading0or0oprefix. - Hex digits A–F
-
Because hexadecimal needs 16 symbols but only 0–9 exist as ordinary digits, the letters A–F stand for the values 10–15:
A=10,B=11,C=12,D=13,E=14,F=15. They may be written in upper or lower case.
FAQ
Does it handle hex letters? Yes — A–F (upper or lower case) are accepted for base 16.
Can I convert negative or fractional numbers? No, this converter works with non-negative whole numbers only.
Why does my decimal answer have thousands separators? They are added for readability; the binary, octal and hex outputs are shown without separators since they are positional codes.