Number systems

  • Binary number system (Radix-2): 0 and 1
  • Octal number system (Radix-8): 0 to 7
  • Decimal number system (Radix-10): 0 to 9
  • Hexadecimal (Hex) number system (Radix-16): 0 to 9, A to F

Decimal to other base

  1. Divide the decimal number by the value of new base
  2. Get the remainder from step 1 as the rightmost (least significant) digit of the new base
  3. Divide the quotient of the previous by the new base
  4. Get the remainder from step 3 as the next digit Repeat step 3 and 4 until the quotient becomes zero

Example

Convert from decimal to binary: Decimal number: 29

StepOperationResultRemainder
Step 129 / 2141
Step 214 / 270
Step 37 / 231
Step 43 / 211
Step 51 / 201

The resulting binary is 11101

Other base to decimal

  1. Determine the column (positional) value of each digit
  2. Multiply the column value by the digits in the corresponding columns
  3. Sum the products calculated in step 2

Example

Convert the binary number to decimal: Binary number: 11101

StepDecimal Number
Step 1((1 × 24) + (1 × 23) + (1 × 22) + (0 × 21) + (1 × 20))
Step 216 + 8 + 4 + 0 + 1
Step 329

The resulting decimal is 29

Other base to non-decimal

  1. Convert the original number to decimal number
  2. Convert the decimal number obtained to new base number

Shortcut - Binary to octal

  1. Split binary digits into group of three (start from the right)
  2. Convert each group of three binary digits to one octal digit

Example

Convert the binary number to octal: Binary number: 10101

StepBinary NumberOctal Number
Step 110101010 101
Step 2101012 5
Step 31010125

The resulting octal is 25

Shortcut - Octal to binary

  1. Convert each octal digit to three binary number (you may treat octal as binary here)
  2. Combine all resulting binary groups into a single binary number

Example

Convert the octal to binary: Octal number: 25

StepOctal NumberBinary Number
Step 1252 5
Step 225010 101
Step 325010101

The resulting binary is 010101

Shortcut - Binary to hex

  1. Split binary digits into groups of four (start from the right)
  2. Convert each group to one hex symbol (you may treat them as decimal)

Example

Convert the binary to hexadecimal: Binary number: 10101

StepBinary NumberHexadecimal Number
Step 1101010001 0101
Step 2101011 5
Step 31010115

The resulting hex is 15

Shortcut - Hex to binary

  1. Convert each hex symbol to a four-digit binary (you may treat hex as decimal here)
  2. Combine all resulting binary groups into a single binary digit

Example

Convert the hex to binary: Hexadecimal number: 15

StepHexadecimal NumberBinary Number
Step 1151 5
Step 2150001 0101
Step 31500010101

The resulting binary is 00010101


Operating_systemINFO1112Data_representationNumber_system_conversionBinaryHexHexadecimal