An Initiative by SAARTHI IAS
Maarg Manthan · Topic 1.10

Base Conversion (Binary, Octal, Hexadecimal to Decimal and Vice Versa)

Quantitative Aptitude › Number System · Topic 1.10

A base (or radix) tells how many digits a number system uses and what each position is worth. Decimal uses base 10, binary base 2, octal base 8 and hexadecimal base 16, and a number is converted by multiplying digits by powers of the base or by repeated division.

Share:
Base Conversion (Binary, Octal, Hexadecimal to Decimal and Vice Versa) - Quantitative Aptitude - MaargX UPSC Maarg Manthan

Quick Answer

A base (or radix) tells how many digits a number system uses and what each position is worth. Decimal uses base 10, binary base 2, octal base 8 and hexadecimal base 16, and a number is converted by multiplying digits by powers of the base or by repeated division.

At a Glance

  • Binary Base 2, digits 0 and 1
  • Octal Base 8, digits 0 to 7
  • Decimal Base 10, digits 0 to 9
  • Hexadecimal Base 16, digits 0 to 9 and A to F
  • To decimal Digit × power of base, then add
  • From decimal Divide repeatedly and read remainders upward

Where Does It Fit?

This topic follows Fermat’s Little Theorem and Wilson’s Theorem Applications and gives a different way of writing integers. It connects to place value in Face Value and Place Value of Digits and to the recurring decimal work in Recurring Decimal to Fraction Conversion.

What Are the Common Number Bases?

In short: the base fixes the digits allowed and the value of each position.

System Base Digits used Position values (right to left)
Binary 2 0, 1 1, 2, 4, 8, 16, …
Octal 8 0 to 7 1, 8, 64, 512, …
Decimal 10 0 to 9 1, 10, 100, 1,000, …
Hexadecimal 16 0 to 9, A to F 1, 16, 256, 4,096, …

In hexadecimal, A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. A subscript shows the base, so 11012 is a binary number.

How Do You Convert to Decimal?

In short: multiply each digit by the value of its position and add.

  • 11012 = 1×8 + 1×4 + 0×2 + 1×1 = 13.
  • 1011012 = 32 + 8 + 4 + 1 = 45.
  • 7258 = 7×64 + 2×8 + 5 = 469.
  • 1A316 = 1×256 + 10×16 + 3 = 419.
  • FF16 = 15×16 + 15 = 255.

How Do You Convert from Decimal and Between Binary, Octal and Hexadecimal?

In short: divide repeatedly by the base and read the remainders from the last to the first. For binary to octal or hexadecimal, group the bits.

Step (156 to binary) Quotient Remainder
156 ÷ 2 78 0
78 ÷ 2 39 0
39 ÷ 2 19 1
19 ÷ 2 9 1
9 ÷ 2 4 1
4 ÷ 2 2 0
2 ÷ 2 1 0
1 ÷ 2 0 1

Reading the remainders upward gives 156 = 100111002. The same number is 2348 and 9C16.

  • Binary to octal: group bits in threes from the right. 1011100112 = 101 | 110 | 011 = 5638.
  • Binary to hexadecimal: group bits in fours. 110101112 = 1101 | 0111 = D716 = 215.
  • Powers: 210 = 1,024, 28 = 256 and 24 = 16 are useful anchors.

Solved Examples

Example 1

Question: Convert 1011012 to decimal.

  1. Write position values from the right: 1, 2, 4, 8, 16, 32.
  2. Digits from the right: 1, 0, 1, 1, 0, 1.
  3. Sum = 1 + 4 + 8 + 32 = 45.

Answer: 45.

Example 2

Question: Convert 1A316 to decimal.

  1. Position values: 1, 16, 256.
  2. A = 10, so the value is 1 × 256 + 10 × 16 + 3.
  3. 256 + 160 + 3 = 419.

Answer: 419.

Example 3

Question: Convert 156 to binary, octal and hexadecimal.

  1. Repeated division by 2 gives remainders 0, 0, 1, 1, 1, 0, 0, 1, so the binary is 10011100.
  2. 156 ÷ 8 = 19 remainder 4; 19 ÷ 8 = 2 remainder 3; 2 ÷ 8 = 0 remainder 2. Octal = 234.
  3. 156 ÷ 16 = 9 remainder 12 (C). Hexadecimal = 9C.

Answer: 100111002, 2348, 9C16.

Example 4

Question: Convert 1011100112 to octal.

  1. Group from the right in threes: 101, 110, 011.
  2. 101 = 5, 110 = 6, 011 = 3.

Answer: 5638.

Example 5

Question: Convert 110101112 to hexadecimal.

  1. Group from the right in fours: 1101, 0111.
  2. 1101 = 13 = D, and 0111 = 7.

Answer: D716, which is 215 in decimal.

Shortcuts and Tricks

  • For binary to octal or hexadecimal, group the bits instead of converting through decimal.
  • Remember 8 = 23 and 16 = 24, which is why grouping works.
  • Always read the remainders from the last to the first.
  • Memorise A to F as 10 to 15.
  • Check by converting back to decimal.

Common Mistakes

  • Reading remainders from first to last.
  • Using the digit 8 or 9 in an octal number.
  • Forgetting that A to F stand for 10 to 15 in hexadecimal.
  • Grouping bits from the left instead of from the right.
  • Mixing up position values, such as using 2, 4, 6 for binary.

Practice Questions

  1. Convert 1011012 to decimal.
  2. Convert 255 to hexadecimal.
  3. Convert 7258 to decimal.
  4. Convert 1,000 to octal.
  5. Convert 63 to binary.
  6. Convert 1,000 to hexadecimal.

Answers: 1) 45; 2) FF; 3) 469; 4) 1750; 5) 111111; 6) 3E8.

Why Is This Topic Important?

  • Digit logic Shows that place value works the same way in every base.
  • Exam use Appears in number system and computer-aptitude questions.
  • Link Extends place value in Face Value and Place Value of Digits.
  • Link Used again in fractions of bases in Recurring Decimal to Fraction Conversion.

What Comes Next?

The next topic is Recurring Decimal to Fraction Conversion, which turns recurring decimals into fractions.

Key Terms and Formulas

  • Base (radix) Number of digits the system uses
  • Binary Base 2
  • Octal Base 8
  • Hexadecimal Base 16
  • Bit A binary digit
  • Repeated division Dividing by the base and noting remainders

Exam Corner

Points to Remember

  • Binary uses 0 and 1; octal uses 0 to 7; hexadecimal uses 0 to 9 and A to F.
  • To decimal: digit × power of base, then add.
  • From decimal: divide by the base, read remainders upward.
  • Binary to octal groups 3 bits; binary to hexadecimal groups 4 bits.
  • 255 = 111111112 = 3778 = FF16.

Do Not Confuse With

  • Octal vs hexadecimal Octal has base 8 and hexadecimal has base 16.
  • Bit vs digit A bit is a binary digit.
  • Reading remainders Upward, not downward.
  • Base subscript vs power 11012 is a base label; 23 is a power.

Memory Hook

Digits times powers to go to decimal; divide and read upward to come back.

GS Relevance

Number-base conversion questions appear in SSC CGL and CAT number system sets and in computer-awareness-style aptitude tests.

Frequently Asked Questions

How do you convert a binary number to decimal?

To convert a binary number to decimal, multiply each digit by the power of 2 that matches its position, counting from the right starting at 2 to the power 0, and add the results. For example, 101101 in binary equals 32 plus 8 plus 4 plus 1, which is 45.

How do you convert a decimal number to binary?

To convert a decimal number to binary, divide the number repeatedly by 2 and note each remainder, then read the remainders from the last to the first. For example, 156 gives the remainders 0, 0, 1, 1, 1, 0, 0, 1, so the binary form is 10011100.

What do the letters A to F mean in hexadecimal?

In hexadecimal, the letters A to F stand for the values 10 to 15, because the system has 16 digits and needs single symbols beyond 9. A equals 10, B equals 11, C equals 12, D equals 13, E equals 14 and F equals 15, so FF in hexadecimal equals 255.

How do you convert binary to octal quickly?

To convert binary to octal quickly, group the bits in threes starting from the right and replace each group by its octal digit. For example, 101110011 splits into 101, 110 and 011, which are 5, 6 and 3, so the octal number is 563.

Why can binary be converted to hexadecimal by grouping four bits?

Binary can be converted to hexadecimal by grouping four bits because 16 equals 2 to the power 4, so each hexadecimal digit represents exactly four binary digits. For example, 11010111 splits into 1101 and 0111, which are D and 7, giving D7 in hexadecimal or 215 in decimal.

PYQ Practice — Statement Analysis

1 The binary number 1101 equals 13 in decimal.
True

8 + 4 + 0 + 1 = 13.

2 The hexadecimal digit F equals 15.
True

A to F stand for 10 to 15.

3 Octal numbers may contain the digit 8.
False

Octal digits are 0 to 7.

4 The binary form of 255 has seven 1s.
False

255 = 11111111 in binary, which has eight 1s.

Share: