How to Convert Number Bases

Step-by-Step Conversion Guide

Learn Conversions

Converting between number bases is a fundamental skill in computing. Whether you're working with binary, hexadecimal, octal, or decimal, the methods are systematic and learnable. This guide walks through each conversion with clear steps and examples.

Decimal to Binary

Method: Repeated Division by 2

  1. Divide the number by 2
  2. Record the remainder (0 or 1)
  3. Divide the quotient by 2
  4. Repeat until quotient is 0
  5. Read remainders bottom-to-top

Example: Convert 156 to Binary

DivisionQuotientRemainder
156 ÷ 2780
78 ÷ 2390
39 ÷ 2191
19 ÷ 291
9 ÷ 241
4 ÷ 220
2 ÷ 210
1 ÷ 201

Reading bottom-to-top: 156₁₀ = 10011100₂

Binary to Decimal

Method: Positional Values

  1. Write position values (powers of 2) under each digit
  2. Multiply each digit by its position value
  3. Add all products

Example: Convert 10011100 to Decimal

Binary digit10011100
Position value1286432168421
Product12800168400

Sum: 128 + 16 + 8 + 4 = 156₁₀

Decimal to Hexadecimal

Method: Repeated Division by 16

  1. Divide by 16, record remainder
  2. Convert remainders 10-15 to A-F
  3. Read remainders bottom-to-top

Example: Convert 748 to Hexadecimal

DivisionQuotientRemainderHex Digit
748 ÷ 164612C
46 ÷ 16214E
2 ÷ 16022

Reading bottom-to-top: 748₁₀ = 2EC₁₆

Hexadecimal to Decimal

Method: Positional Values

  1. Convert A-F to 10-15
  2. Multiply each digit by its position value (powers of 16)
  3. Add all products

Example: Convert 2EC to Decimal

  • 2 × 16² = 2 × 256 = 512
  • E (14) × 16¹ = 14 × 16 = 224
  • C (12) × 16⁰ = 12 × 1 = 12

Sum: 512 + 224 + 12 = 748₁₀

Binary to Hexadecimal

Method: Group and Convert

  1. Group binary digits into sets of 4 (from right)
  2. Pad with leading zeros if needed
  3. Convert each group to its hex digit

Example: Convert 10011100 to Hexadecimal

  • Group: 1001 | 1100
  • 1001 = 9
  • 1100 = C

Result: 10011100₂ = 9C₁₆

Hexadecimal to Binary

Method: Expand Each Digit

  1. Convert each hex digit to 4 binary digits
  2. Concatenate the results

Example: Convert A7F to Binary

  • A = 1010
  • 7 = 0111
  • F = 1111

Result: A7F₁₆ = 101001111111₂

Octal Conversions

Binary to Octal

Group binary digits in sets of 3 (from right):

  • 110 101 011 (add leading zeros: 0 110 101 011)
  • 110 = 6, 101 = 5, 011 = 3
  • Result: 653₈

Octal to Binary

Convert each octal digit to 3 binary digits:

  • 653₈
  • 6 = 110, 5 = 101, 3 = 011
  • Result: 110101011₂

Decimal to Octal

Divide repeatedly by 8, read remainders bottom-to-top.

Any Base to Any Base

General Method

  1. Convert source to decimal (intermediate step)
  2. Convert decimal to target base

Example: Convert 3A₁₆ to Octal

Step 1: Hex to Decimal

  • 3 × 16 + 10 × 1 = 48 + 10 = 58₁₀

Step 2: Decimal to Octal

  • 58 ÷ 8 = 7 remainder 2
  • 7 ÷ 8 = 0 remainder 7
  • Result: 72₈

3A₁₆ = 72₈

Quick Reference Summary

ConversionMethod
Decimal → BinaryDivide by 2, read remainders backward
Binary → DecimalSum (digit × power of 2)
Decimal → HexDivide by 16, read remainders backward
Hex → DecimalSum (digit × power of 16)
Binary → HexGroup by 4, convert each group
Hex → BinaryExpand each digit to 4 bits
Binary → OctalGroup by 3, convert each group
Octal → BinaryExpand each digit to 3 bits

Conclusion

Converting between number bases follows systematic methods: division for decimal to other bases, positional multiplication for other bases to decimal, and grouping shortcuts for binary/hex/octal conversions. With practice, these conversions become second nature. The binary-hex shortcut (4 bits per hex digit) is particularly valuable in programming and computing contexts.

Related Articles

How to Convert Number Bases: Binary, Decimal, Hex Guide | YounitConverter