Numbers are the language of mathematics and daily life. Most of us are familiar with the decimal system, which uses ten digits (0 to 9) to represent numbers. But did you know that numbers can be represented in different bases or radices? A number base defines how many unique digits, including zero, a number system uses to represent numbers.
For example, the decimal system is base 10 because it uses 10 digits. The binary system is base 2, using only digits 0 and 1. Other common bases include octal (base 8) and hexadecimal (base 16). Different bases are important in fields like computer science, digital electronics, and cryptography because computers operate using binary, but humans find decimal easier to understand.
In this chapter, you will learn how to convert numbers between these bases, understand the logic behind each system, and master techniques to switch from one base to another efficiently-skills essential for competitive exams and practical applications.
Every number system uses a positional notation, meaning the position of each digit determines its value. The value of a digit depends on the base and its position, counted from right to left starting at zero.
For example, in the decimal number 345:
The total value is the sum of these: \(300 + 40 + 5 = 345\).
This principle applies to all bases. The base tells us the number of digits and the value of each position.
| Position (from right) | Decimal (Base 10) | Binary (Base 2) | Octal (Base 8) | Hexadecimal (Base 16) |
|---|---|---|---|---|
| 0 | 100 = 1 | 20 = 1 | 80 = 1 | 160 = 1 |
| 1 | 101 = 10 | 21 = 2 | 81 = 8 | 161 = 16 |
| 2 | 102 = 100 | 22 = 4 | 82 = 64 | 162 = 256 |
| 3 | 103 = 1000 | 23 = 8 | 83 = 512 | 163 = 4096 |
Notice how place values increase exponentially with the base. This is why the same digit in different bases represents different values.
To convert a decimal number (base 10) to another base such as binary (base 2), octal (base 8), or hexadecimal (base 16), we use the division-remainder method. This method involves repeatedly dividing the decimal number by the target base and recording the remainders.
Why does this work? Because dividing by the base extracts the least significant digit (rightmost digit) in that base, and the remainders collected in reverse order form the converted number.
graph TD Start[Start with decimal number N] Divide[Divide N by base b] Remainder[Record remainder r] Update[Update N = quotient of division] Check{Is N = 0?} End[Write remainders in reverse order] Start --> Divide Divide --> Remainder Remainder --> Update Update --> Check Check -- No --> Divide Check -- Yes --> EndFollow these steps:
To convert a number from binary, octal, or hexadecimal to decimal, use the positional value method. Multiply each digit by its base raised to the power of its position (starting from 0 on the right) and sum all these values.
For example, to convert hexadecimal 2F to decimal:
Note: In hexadecimal, digits 10 to 15 are represented by letters A to F.
Sometimes you need to convert directly between two non-decimal bases, such as binary to octal or binary to hexadecimal. There are two main methods:
| Base | Group Size | Example Binary Group | Equivalent Digit |
|---|---|---|---|
| Octal (Base 8) | 3 bits | 101 | 5 |
| Hexadecimal (Base 16) | 4 bits | 1101 | D (13 decimal) |
This method is faster and avoids intermediate decimal conversion.
Step 1: Divide 156 by 2.
156 / 2 = 78, remainder = 0
Step 2: Divide 78 by 2.
78 / 2 = 39, remainder = 0
Step 3: Divide 39 by 2.
39 / 2 = 19, remainder = 1
Step 4: Divide 19 by 2.
19 / 2 = 9, remainder = 1
Step 5: Divide 9 by 2.
9 / 2 = 4, remainder = 1
Step 6: Divide 4 by 2.
4 / 2 = 2, remainder = 0
Step 7: Divide 2 by 2.
2 / 2 = 1, remainder = 0
Step 8: Divide 1 by 2.
1 / 2 = 0, remainder = 1 (stop here)
Step 9: Write remainders from last to first:
1 0 0 1 1 1 0 0
Answer: \(156_{10} = 10011100_2\)
Step 1: Write the binary digits with their positions:
Positions (right to left): 0 1 2 3 4 5
Digits: 1 1 0 1 0 1
Step 2: Calculate each digit x \(2^{position}\):
Step 3: Sum all values:
32 + 16 + 0 + 4 + 0 + 1 = 53
Answer: \(110101_2 = 53_{10}\)
Step 1: Identify the digits and their decimal equivalents:
2 = 2, F = 15
Step 2: Assign positions from right (0) to left:
F at position 0, 2 at position 1
Step 3: Calculate each digit x \(16^{position}\):
Step 4: Sum the values:
32 + 15 = 47
Answer: \(2F_{16} = 47_{10}\)
Step 1: Group binary digits in sets of 3 from right to left:
101 101
Step 2: Convert each group to decimal (octal digit):
Step 3: Write the octal number:
55
Answer: \(101101_2 = 55_8\)
Step 1: Convert octal 725 to decimal.
Positions: 5 at 0, 2 at 1, 7 at 2
\(7 \times 8^2 + 2 \times 8^1 + 5 \times 8^0 = 7 \times 64 + 2 \times 8 + 5 \times 1 = 448 + 16 + 5 = 469\)
Step 2: Convert decimal 469 to hexadecimal using division-remainder method.
Step 3: Write remainders from last to first:
1 D 5
Answer: \(725_8 = 1D5_{16}\)
When to use: When converting binary numbers directly to octal or hexadecimal to speed up the process.
When to use: When working with hexadecimal numbers to quickly identify digit values and avoid confusion.
When to use: When converting decimal numbers to binary, octal, or hexadecimal efficiently.
When to use: When direct base-to-base conversion is complex or unknown, especially for bases without simple grouping relations.
When to use: For all positional number system conversions to avoid miscalculations.
Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.
Go to practice →