What is the Base Conversion Calculator?
This tool converts a number from one positional numeral system to another — between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). It is widely used in computer science, digital electronics and programming where the same value is represented differently depending on context.
How to use it
Type the number you want to convert, choose the base it is currently written in under "From base", and choose the base you want under "To base". The calculator shows the converted result and also lists the plain decimal (base 10) equivalent so you can sanity-check the conversion.
The formula explained
Any number is the sum of each digit multiplied by the base raised to the power of its position: $$\text{Value} = \sum_{i} d_i \cdot \text{base}^{\,i}$$ counting positions from the right starting at 0. To go the other way, the calculator repeatedly divides the decimal value by the target base and records the remainders; reading those remainders from last to first gives the digits in the new base.
Worked example
Convert binary 1010 to decimal: $$1\cdot 2^3 + 0\cdot 2^2 + 1\cdot 2^1 + 0\cdot 2^0 = 8 + 0 + 2 + 0 = 10$$ To convert decimal 255 to hex: \(255 \div 16 = 15\) remainder 15 (F), \(15 \div 16 = 0\) remainder 15 (F), so the result is FF.
Common Values Across Bases
The table below shows the same numeric value expressed in all four common positional bases: binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). The small consecutive values (0–16) are useful for learning how each base counts, while the powers of two and byte boundaries (32, 64, 128, 255, 256) appear constantly in computing because memory and registers are organized around groups of bits.
| Decimal (base 10) | Binary (base 2) | Octal (base 8) | Hexadecimal (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 |
Notice that one hexadecimal digit corresponds exactly to four binary digits (a nibble), so 255 fits in two hex digits (FF) and eight binary digits, the size of a single byte.
Key Terms in Number Systems
- Base (radix)
- The number of distinct digit symbols a positional number system uses, and the value that each successive place is multiplied by. Base 10 uses ten symbols (0–9); base 2 uses two (0–1). The terms base and radix are interchangeable.
- Binary (base 2)
- A number system using only the digits 0 and 1. Each place represents a power of two. Binary is the native language of digital electronics because a circuit easily represents two states (off/on).
- Octal (base 8)
- A number system using digits 0–7, where each place is a power of eight. One octal digit maps neatly onto three binary digits, which historically made it a compact shorthand for binary.
- Decimal (base 10)
- The everyday number system using digits 0–9, with each place a power of ten. It is the default base for human arithmetic.
- Hexadecimal (base 16)
- A number system using digits 0–9 and the letters A–F (representing 10–15), with each place a power of sixteen. One hex digit equals exactly four binary digits, making hex a compact way to write byte values.
- Digit
- A single symbol within a number. The allowed digits depend on the base — for example, base 16 permits the digit symbols 0–9 and A–F.
- Positional notation
- A system in which the value of a digit depends on its position. The value of a number is the sum of each digit multiplied by the base raised to the power of its place, for example \(101_2 = 1\cdot2^2 + 0\cdot2^1 + 1\cdot2^0 = 5\).
- Most significant digit (MSD)
- The leftmost digit of a number — the one in the highest-value place, contributing the largest amount to the total.
- Least significant digit (LSD)
- The rightmost digit of a number — the one in the lowest-value place (the units place), contributing the smallest amount.
- Nibble
- A group of four binary digits (bits). A nibble holds values 0–15 and corresponds to exactly one hexadecimal digit.
- Byte
- A group of eight bits (two nibbles), able to represent 256 distinct values (0–255, or 00–FF in hex). The byte is the standard unit of digital storage.
FAQ
Does it handle letters in hex? Yes — hexadecimal uses A–F for 10–15, and input is case-insensitive.
Can I convert negative numbers? Yes, prefix the value with a minus sign and the sign is preserved.
What if my input is invalid? If a digit is not allowed in the chosen source base (for example "9" in binary), the result shows "Invalid input".