Skip to content
Computer ScienceCBSE Class 11 · Encoding Schemes and Number System

Number System Conversions Class 11: Decimal, Binary, Octal and Hexadecimal

Updated 17 October 2026 · Fact-checked

A number system with base b uses b symbols and each digit has a positional value of b raised to its position. To convert a base-b number to decimal, expand it; to convert decimal to base b, divide the integer part repeatedly by b and multiply the fractional part repeatedly by b. Binary to octal groups three bits and binary to hexadecimal groups four bits from the point.

Understand Number System Conversions: Decimal, Binary, Octal and Hexadecimal

Bases. Binary 2 (0, 1); octal 8 (0 to 7); decimal 10; hexadecimal 16 (0 to 9 and A to F, where A = 10, B = 11, C = 12, D = 13, E = 14, F = 15).

Any base to decimal. Multiply each digit by base raised to its place value and add. 2F in hexadecimal = 2 x 16 + 15 = 47. 1011 in binary = 8 + 0 + 2 + 1 = 11. 345 in octal = 3 x 64 + 4 x 8 + 5 = 192 + 32 + 5 = 229.

Decimal to base b (integer). Divide repeatedly by b; read the remainders from last to first. 156 to binary: 156 ÷ 2 gives remainders 0, 0, 1, 1, 1, 0, 0, 1, so reading upward 10011100. 156 in octal is 234; in hexadecimal 9C (156 = 9 x 16 + 12).

Decimal fraction to base b. Multiply the fractional part by b repeatedly; the integer parts, read from the top, give the digits. 0.625 in binary: 0.625 x 2 = 1.25 (1); 0.25 x 2 = 0.5 (0); 0.5 x 2 = 1.0 (1). So 0.625 = 0.101 in binary. 11.25 in decimal = 1011.01 in binary.

Binary to octal. Group in threes from the point (pad with zeros): 1101101 = 001 101 101 = 155 in octal. Binary to hexadecimal. Group in fours: 1101101 = 0110 1101 = 6D. Octal or hexadecimal to binary: replace each digit by its 3-bit or 4-bit code.

Octal to hexadecimal. Go through binary or decimal: 345 octal = 011 100 101 = 1110 0101 = E5.

Why hexadecimal? A byte (8 bits) needs two hexadecimal digits, so memory addresses and colour codes are short and easy to read.

Number System Conversions: Decimal, Binary, Octal and Hexadecimal: key facts

Place value
  • Digit x base to the power of position
  • Add all terms
  • Positions count from 0 on the right
Any base to decimal.
Decimal to base b
Integer part: divide by b, read remainders upward | Fractional part: multiply by b, read integer parts downward
Repeat until zero.
Grouping
  • Binary to octal: groups of 3 bits
  • Binary to hexadecimal: groups of 4 bits
  • Group from the point outward
Pad with zeros.
Hex digits
  • A = 10
  • B = 11
  • C = 12
  • D = 13
  • E = 14
  • F = 15
Learn the six letters.

How to answer Number System Conversions: Decimal, Binary, Octal and Hexadecimal questions

Pick the method by the pair of bases and write each step.

  1. 1If the target is decimal, expand with place values.
  2. 2If the source is decimal, divide (integer) and multiply (fraction).
  3. 3For binary with octal or hexadecimal, group bits in threes or fours.
  4. 4For octal with hexadecimal, go through binary.
  5. 5Check by converting back or with the Python functions bin(), oct(), hex(), int().

Number System Conversions: Decimal, Binary, Octal and Hexadecimal in real life

The idea, met in an everyday situation. Answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.

A colour code

Suppose a web colour has the hexadecimal value 7B for one of its components.

What decimal value is this?

Try it first, then show the solutionSolution
  1. 7 x 16 = 112.
  2. 112 + 11 = 123.

Answer: 7B in hexadecimal is 123.

Memory hook: First digit times 16, plus the second.

Tricks to remember Number System Conversions: Decimal, Binary, Octal and Hexadecimal

Short memory aids. Say each one aloud once, then use it on a question the same day.

  • Remainders upward

    Read the division remainders from bottom to top.

    Use it when: Decimal to base b.

  • 3 for octal, 4 for hex

    Octal groups of three bits; hexadecimal groups of four.

    Use it when: Grouping.

Number System Conversions: Decimal, Binary, Octal and Hexadecimal: solved examples

Ordered from board level to HOTS. Try each one before you open the solution.

Example 1: Hex digit · 1 mark · MCQBoard level

The decimal value of the hexadecimal digit D is:
(a) 11
(b) 12
(c) 13
(d) 14

Try it first, then show the solutionSolution
  1. A = 10, so D = 13.

Answer: (c) 13

Example 2: To decimal · 3 marks · Short answerBoard level

Convert to decimal: (i) 1011 in binary; (ii) 2F in hexadecimal; (iii) 345 in octal. (3 marks)

Try it first, then show the solutionSolution
  1. (i) 8 + 0 + 2 + 1 = 11.
  2. (ii) 2 x 16 + 15 = 47.
  3. (iii) 3 x 64 + 4 x 8 + 5 = 229.

Answer: (i) 11 (ii) 47 (iii) 229

Example 3: Decimal to three bases · 4 marks · Short answerHarder board level

Convert decimal 203 to binary, octal and hexadecimal. (4 marks)

Try it first, then show the solutionSolution
  1. Binary: 203 = 128 + 64 + 8 + 2 + 1 = 11001011.
  2. Octal: 203 ÷ 8 = 25 remainder 3; 25 ÷ 8 = 3 remainder 1; 3 ÷ 8 = 0 remainder 3: 313.
  3. Hexadecimal: 203 ÷ 16 = 12 remainder 11 (B): CB.
  4. Check: 11001011 = 1100 1011 = CB.

Answer: 203 = 11001011 (binary) = 313 (octal) = CB (hexadecimal).

Example 4: Binary grouping and fractions · 5 marks · Short answerHarder board level

Convert 1101101 (binary) to octal and hexadecimal; convert decimal 11.25 to binary. (5 marks)

Try it first, then show the solutionSolution
  1. Octal: 001 101 101 = 155.
  2. Hexadecimal: 0110 1101 = 6D.
  3. Integer 11 = 1011. Fraction 0.25 x 2 = 0.5 (0); 0.5 x 2 = 1.0 (1): 0.01.
  4. 11.25 = 1011.01 in binary.

Answer: 1101101 = 155 (octal) = 6D (hexadecimal); 11.25 = 1011.01.

Example 5: Octal to hexadecimal · 5 marks · Short answerHOTS / competency

Convert 345 (octal) to hexadecimal in two ways and check that they agree. A 3-digit octal number can have a maximum value of 511 in decimal: verify. (5 marks)

Try it first, then show the solutionSolution
  1. Through binary: 3 = 011, 4 = 100, 5 = 101 gives 011100101; regroup in fours: 1110 0101 = E5.
  2. Through decimal: 3 x 64 + 4 x 8 + 5 = 229; 229 ÷ 16 = 14 remainder 5, so E5.
  3. Both give E5.
  4. The largest 3-digit octal number is 777 = 7 x 64 + 7 x 8 + 7 = 448 + 56 + 7 = 511.

Answer: 345 octal = E5; 777 octal = 511.

Where students lose marks in Number System Conversions: Decimal, Binary, Octal and Hexadecimal

The slips examiners see most often, and what to write instead.

  • Mistake: Reading remainders downward

    Writing in the order they were found.

    Wrong working

    156 to binary: 00111001.

    Right working

    156 to binary: 10011100.

    Do this: Read remainders from last to first.

    Usually costs: 1 mark

  • Mistake: Using 3-bit groups for hexadecimal

    Confusing the group sizes.

    Wrong working

    1101101 = 155 for hexadecimal.

    Right working

    1101101 = 6D (4-bit groups).

    Do this: Hex uses 4 bits; octal uses 3.

    Usually costs: 1 mark

  • Mistake: Ignoring letters beyond 9

    Not converting A to F.

    Wrong working

    9C = 9 x 16 + 3.

    Right working

    9C = 9 x 16 + 12 = 156.

    Do this: C = 12.

    Usually costs: 1 mark

Exam tips

  • Show the division table for each conversion.
  • Write place values above each digit before expanding.
  • Check by converting back to decimal.
  • You can verify answers in Python with int("9C", 16).

Practice questions on Number System Conversions: Decimal, Binary, Octal and Hexadecimal

Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.

  1. Q1 · 1 mark · MCQBoard level

    The binary equivalent of decimal 45 is:
    (a) 101101
    (b) 110101
    (c) 101011
    (d) 100111

    Hint

    32 + 8 + 4 + 1.

    Answer

    (a) 101101

  2. Q2 · 3 marks · Short answerHarder board level

    Convert 110110 (binary) to octal and hexadecimal. (3 marks)

    Hint

    Group in threes and fours.

    Answer

    Octal: 110 110 = 66. Hexadecimal: 0011 0110 = 36. Check: 54 in decimal = 66 octal = 36 hexadecimal.

  3. Q3 · 4 marks · Short answerHarder board level

    Convert 725 (octal) to binary and decimal, and 1AF (hexadecimal) to decimal. (4 marks)

    Hint

    Octal digits to 3 bits.

    Answer

    725 octal: 7 = 111, 2 = 010, 5 = 101 gives 111010101. Decimal = 7 x 64 + 2 x 8 + 5 = 469. 1AF = 1 x 256 + 10 x 16 + 15 = 431.

  4. Q4 · 1 mark · Assertion-reasonHarder board level

    Assertion (A): One hexadecimal digit corresponds to exactly four binary digits.
    Reason (R): The base 16 is equal to 2 to the power 4.
    (a) Both A and R are true, and R is the correct explanation of A.
    (b) Both A and R are true, but R is not the correct explanation of A.
    (c) A is true, but R is false.
    (d) A is false, but R is true.

    Hint

    16 = 2^4.

    Answer

    (a) Both A and R are true, and R is the correct explanation of A.

  5. Q5 · 5 marks · Short answerHOTS / competency

    A memory address is written as 3C in hexadecimal. Write its binary and decimal forms, and show how many bits are needed to write 3C in binary without leading zeros. Compare the length of 3C with its binary form and give one advantage of the hexadecimal form. (5 marks)

    Hint

    3 = 0011, C = 1100.

    Answer

    3C = 0011 1100, so 111100 without leading zeros (6 bits). Decimal = 3 x 16 + 12 = 60. Hexadecimal needs 2 symbols against 6 bits: shorter, easier to read and write, and each digit maps to exactly 4 bits.

Test your recall

Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.

  1. 1.Base of hexadecimal?Show answer

    16.

  2. 2.Value of F?Show answer

    15.

  3. 3.Group size for octal?Show answer

    3 bits.

  4. 4.Group size for hexadecimal?Show answer

    4 bits.

  5. 5.How to convert a fraction?Show answer

    Multiply repeatedly by the base.

Number System Conversions: Decimal, Binary, Octal and Hexadecimal: frequently asked questions

Why is hexadecimal used?

It writes long binary numbers compactly; one digit equals four bits.

Can the same number be written in different bases?

Yes; only the representation changes, not the value.

How do I check my answer in Python?

Use bin(), oct(), hex() and int(text, base).