How to Use the Calculator?
To use this calculator, simply enter a value in any one field, such as decimal, binary, octal, or hexadecimal, and the converter will instantly show the matching values in the other fields. You can start with whichever number format you already have, and there is no need to press a button. To convert another value, simply edit or clear any field and type the new number.
Understanding Number Systems
Counting is something we do so naturally that we rarely think about how we do it. The way we write numbers is based on a specific set of rules called a Number System.
At the heart of every number system is a Base (also called a radix). The base tells you two things: how many unique symbols or digits are available to use and the multiplier used for the “place value” of each digit.
There are various types of number systems in mathematics. The four most common number system types are:
- Decimal Number System (Base-10)
- Binary Number System (Base-2)
- Octal Number System (Base-8)
- Hexadecimal Number System (Base-16)
Let’s understand each number system in detail.
The Decimal Number System
The decimal system is the number system we use every single day. When we write numbers like $25$, $108$, or $3,450$, we are using decimal numbers. The word “decimal” comes from the idea of ten, because the decimal system uses 10 digits: $0,1,2,3,4,5,6,7,8,9$. And each position in a number represents a power of $10$.
For example, consider $345_{10}$. The digit $5$ is in the ones place, the $4$ is in the tens place, and the $3$ is in the hundreds place. The number can be expanded like this:

This may seem obvious because you already know decimal numbers, but practicing this expansion is helpful because you will use the exact same method for binary, octal, and hexadecimal numbers.
The Binary Number System
Computers do not naturally understand numbers in the same way humans do. Computers work using tiny electrical signals that are either off or on. Because of this, computers use the binary number system, or Base 2 system, which has only two digits: $0$ and $1$.
In binary, the place values are powers of $2$. The rightmost bit has a value of $2^0$, which is $1$. The next bit to the left has a value of $2^1$, which is $2$. The next position is $2^2$, which is $4$, and so on.
For example, the binary number $1010_2$ has a $1$ in the $3$rd place and a $1$ in the $1$st place. So its decimal value is $2^3+2^1=8+2=10$. That is why $1010_2$ equals $10_{10}$.

The Octal Number System
Octal number system is less common today but was heavily used in early computing because it neatly bundles binary digits into groups of three.
The octal system is base $8$. It uses the digits $0,1,2,3,4,5,6,7$.
The place values in octal are powers of $8$. From right to left, they are $8^0$, $8^1$, $8^2$, $8^3$, and so on.
For example, let us convert $247_8$ into decimal. We expand it using powers of $8$.

Therefore, $247_8$ is equal to $167_{10}$.
The Hexadecimal Number System
Modern computers process data in larger chunks (like 8-bit bytes, 16-bit words, etc.). Writing out long strings of 1s and 0s is tedious and prone to human error. Hexadecimal (often just called “Hex”) compresses four binary digits into a single character, making it the preferred format for microcontroller programming and memory addresses.
The hexadecimal system is base $16$. Since decimal only gives us ten digits, hexadecimal needs extra symbols to represent values from ten to fifteen. It uses the digits $0$ through $9$, and then the letters $A$, $B$, $C$, $D$, $E$, and $F$.
$$A_{16}=10_{10}$$
$$B_{16}=11_{10}$$
$$C_{16}=12_{10}$$
$$D_{16}=13_{10}$$
$$E_{16}=14_{10}$$
$$F_{16}=15_{10}$$
The place values in hexadecimal are powers of $16$. From right to left, they are $16^0$, $16^1$, $16^2$, $16^3$, and so on.
For example, let us convert $2FC_{16}$ into decimal. We expand it using powers of $16$.

So, $2FC_{16}$ is equal to $764_{10}$.
Converting From Any Base to Decimal
To convert a number from binary, octal, or hexadecimal to decimal, the method is always the same. You multiply each digit by the place value of its position, and then add all the results. The base decides what the place values are.
The general rule is:
$$(d_nd_{n-1}\dots d_2d_1d_0)_b = d_n b^n + d_{n-1} b^{n-1} + \dots + d_2 b^2 + d_1 b^1 + d_0 b^0$$
Here, $b$ is the base, and the digits are $d_n,d_{n-1},\dots,d_0$. The rightmost digit is multiplied by $b^0$, the next digit is multiplied by $b^1$, and so on.
Let us try a binary example. Convert $11010_2$ to decimal.
$$11010_2=1\times2^4+1\times2^3+0\times2^2+1\times2^1+0\times2^0$$
$$11010_2=1\times16+1\times8+0\times4+1\times2+0\times1$$
$$11010_2=16+8+0+2+0$$
$$11010_2=26_{10}$$
Now let us try an octal example. Convert $356_8$ to decimal.
$$356_8=3\times8^2+5\times8^1+6\times8^0$$
$$356_8=3\times64+5\times8+6\times1$$
$$356_8=192+40+6$$
$$356_8=238_{10}$$
Now let us try a hexadecimal example. Convert $1A3_{16}$ to decimal.
$$1A3_{16}=1\times16^2+A\times16^1+3\times16^0$$
$$1A3_{16}=1\times256+10\times16+3\times1$$
$$1A3_{16}=256+160+3$$
$$1A3_{16}=419_{10}$$
Converting From Decimal to Another Base
To convert from decimal to another base, we repeatedly divide by the new base and write down the remainders. The remainders become the digits of the new number. The important part is that we read the remainders from bottom to top.
Suppose we want to convert $26_{10}$ to binary. Since binary is base $2$, we repeatedly divide by $2$.
$$26\div2=13\text{ remainder }0$$
$$13\div2=6\text{ remainder }1$$
$$6\div2=3\text{ remainder }0$$
$$3\div2=1\text{ remainder }1$$
$$1\div2=0\text{ remainder }1$$
Now read the remainders from bottom to top: $11010_2$.
$$26_{10}=11010_2$$
Now let us convert $167_{10}$ to octal. Since octal is base $8$, we repeatedly divide by $8$.
$$167\div8=20\text{ remainder }7$$
$$20\div8=2\text{ remainder }4$$
$$2\div8=0\text{ remainder }2$$
Reading the remainders from bottom to top gives $247_8$.
$$167_{10}=247_8$$
Now let us convert $47_{10}$ to hexadecimal. Since hexadecimal is base $16$, we repeatedly divide by $16$.
$$47\div16=2\text{ remainder }15$$
$$2\div16=0\text{ remainder }2$$
The remainder $15$ is written as $F$ in hexadecimal. Reading from bottom to top gives $2F_{16}$.
$$47_{10}=2F_{16}$$
Converting Binary to Octal
Binary and octal are closely connected because $8=2^3$. This means that one octal digit matches exactly three binary digits. Because of this, converting binary to octal is much easier than converting through decimal.
To convert binary to octal, group the binary digits into groups of three, starting from the right side. If the leftmost group does not have three digits, add zeros to the left. These extra zeros do not change the value of the number.
Let us convert $110101_2$ to octal. First, group the digits into threes from the right.
$$110101_2=(110)(101)_2$$
Now convert each group into its octal value. The group $110_2$ equals $6_{10}$, and the group $101_2$ equals $5_{10}$.
$$110_2=6_8$$
$$101_2=5_8$$
So:
$$110101_2=65_8$$
Let us try another example. Convert $10111_2$ to octal. First group from the right. Since $10111$ has five digits, the left group has only two digits, so we add one zero to the left.
$$10111_2=010111_2$$
$$010111_2=(010)(111)_2$$
Now convert each group. The group $010_2$ equals $2$, and $111_2$ equals $7$.
$$010_2=2_8$$
$$111_2=7_8$$
Therefore:
$$10111_2=27_8$$
Converting Octal to Binary
Converting octal to binary is the reverse of converting binary to octal. Since each octal digit represents three binary digits, we replace each octal digit with its three-bit binary form.
For example, convert $65_8$ to binary. The digit $6$ is $110_2$, and the digit $5$ is $101_2$.
$$6_8=110_2$$
$$5_8=101_2$$
So:
$$65_8=110101_2$$
Now let us convert $247_8$ to binary. Each octal digit becomes a group of three binary digits.
$$2_8=010_2$$
$$4_8=100_2$$
$$7_8=111_2$$
So:
$$247_8=010100111_2$$
Usually, we remove leading zeros at the very beginning of a binary number, so:
$$247_8=10100111_2$$
Converting Binary to Hexadecimal
Binary and hexadecimal are closely connected because $16=2^4$. This means that one hexadecimal digit matches exactly four binary digits. Because of this, hexadecimal is a very compact way to write binary numbers.
To convert binary to hexadecimal, group the binary digits into groups of four, starting from the right side. If the leftmost group does not have four digits, add zeros to the left. Then convert each group into one hexadecimal digit.
Let us convert $101111_2$ to hexadecimal. First, group the digits into fours from the right.
$$101111_2=00101111_2$$
$$00101111_2=(0010)(1111)_2$$
Now convert each group. The group $0010_2$ equals $2$, and $1111_2$ equals $15$, which is $F$ in hexadecimal.
$$0010_2=2_{16}$$
$$1111_2=F_{16}$$
So:
$$101111_2=2F_{16}$$
Let us try another example. Convert $11010110_2$ to hexadecimal.
$$11010110_2=(1101)(0110)_2$$
The group $1101_2$ equals $13$, which is $D$ in hexadecimal. The group $0110_2$ equals $6$.
$$1101_2=D_{16}$$
$$0110_2=6_{16}$$
Therefore:
$$11010110_2=D6_{16}$$
Converting Hexadecimal to Binary
To convert hexadecimal to binary, replace each hexadecimal digit with its four-bit binary form. This is the reverse of converting binary to hexadecimal.
For example, convert $2F_{16}$ to binary. The digit $2$ is $0010_2$, and $F$ is $1111_2$.
$$2_{16}=0010_2$$
$$F_{16}=1111_2$$
So:
$$2F_{16}=00101111_2$$
After removing leading zeros, we get:
$$2F_{16}=101111_2$$
Now let us convert $A7_{16}$ to binary. Remember that $A_{16}=10_{10}$.
$$A_{16}=1010_2$$
$$7_{16}=0111_2$$
So:
$$A7_{16}=10100111_2$$
Converting Octal to Hexadecimal
There is no single-digit shortcut between octal and hexadecimal like there is between binary and octal or binary and hexadecimal. The easiest method is usually to convert octal to binary first, and then convert binary to hexadecimal.
Let us convert $247_8$ to hexadecimal. First convert each octal digit into three binary digits.
$$2_8=010_2$$
$$4_8=100_2$$
$$7_8=111_2$$
So:
$$247_8=010100111_2$$
Remove the leading zero if needed:
$$010100111_2=10100111_2$$
Now group the binary number into groups of four from the right. Add zeros to the left if necessary.
$$10100111_2=(1010)(0111)_2$$
Now convert each group into hexadecimal.
$$1010_2=A_{16}$$
$$0111_2=7_{16}$$
Therefore:
$$247_8=A7_{16}$$
Converting Hexadecimal to Octal
To convert hexadecimal to octal, we can again use binary as the bridge. First convert each hexadecimal digit into four binary digits. Then regroup the binary digits into groups of three from the right, and finally convert each group into an octal digit.
Let us convert $A7_{16}$ to octal. First convert each hexadecimal digit to binary.
$$A_{16}=1010_2$$
$$7_{16}=0111_2$$
So:
$$A7_{16}=10100111_2$$
Now group the binary digits into groups of three from the right. Add zeros to the left if needed.
$$10100111_2=010100111_2$$
$$010100111_2=(010)(100)(111)_2$$
Convert each group to octal.
$$010_2=2_8$$
$$100_2=4_8$$
$$111_2=7_8$$
Therefore:
$$A7_{16}=247_8$$
Quick Reference for Binary, Octal, Decimal, and Hexadecimal Digits
A very useful skill is knowing the values from $0$ to $15$ in decimal, binary, octal, and hexadecimal. This helps you convert small groups quickly.
| Decimal | Binary | Octal | Hexadecimal |
| 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 |
