Skip to main content
ToolsWorld
TextImageFinanceHealthEducationCalculatorsDeveloperEverydayGuides
TextImageFinanceHealthEducationCalculatorsDeveloperEverydayGuides
About ToolsWorldContact ToolsWorldPrivacy PolicyTerms of Use
  1. Home
  2. Guides
  3. How to Convert Binary to Decimal and Hex

How to Convert Binary to Decimal and Hex

Computers store numbers in binary (base 2). People use decimal (base 10), and programmers often use hexadecimal (base 16). Converting between them is easy once you know place values.

Also in: اردو · العربية

On this page 2 min read
  1. Number systems in brief
  2. Binary to decimal
  3. Decimal to binary
  4. Binary to hexadecimal
  5. Hexadecimal to decimal
  6. Quick reference
  7. Where you will see these
  8. Check your work

Number systems in brief

  • Binary uses only the digits 0 and 1.
  • Octal uses the digits 0 to 7.
  • Decimal uses the digits 0 to 9.
  • Hexadecimal uses 0 to 9 and the letters A to F, where A is 10 and F is 15.

Binary to decimal

Each binary digit has a place value that doubles from right to left: 1, 2, 4, 8, 16, 32, 64, 128. Add up the place values where the digit is 1.

Example: binary 1101 = 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1 = 8 + 4 + 0 + 1 = 13.

Example: binary 10110 = 16 + 0 + 4 + 2 + 0 = 22.

Decimal to binary

Divide the number by 2 again and again, and write down each remainder. Then read the remainders from the bottom to the top.

Example: 25 / 2 = 12 remainder 1. 12 / 2 = 6 remainder 0. 6 / 2 = 3 remainder 0. 3 / 2 = 1 remainder 1. 1 / 2 = 0 remainder 1. Reading upward gives 11001.

Binary to hexadecimal

Group the binary digits in fours, starting from the right, and convert each group to one hex digit.

Example: 11010111 splits into 1101 and 0111. 1101 is 13, which is D, and 0111 is 7. So the hex value is D7, which equals 215 in decimal.

Hexadecimal to decimal

Hex place values are powers of 16: 1, 16, 256 and so on. Example: 2F = 2 x 16 + 15 = 47. And FF = 15 x 16 + 15 = 255.

Quick reference

Decimal = binary = hex: 8 = 1000 = 8, 9 = 1001 = 9, 10 = 1010 = A, 11 = 1011 = B, 12 = 1100 = C, 13 = 1101 = D, 14 = 1110 = E, 15 = 1111 = F.

Where you will see these

  • Color codes such as #FF0000 use hex pairs for red, green and blue.
  • Memory addresses and error codes are often written in hex.
  • Network masks and file permissions are easier to understand in binary.

Check your work

Type a number into the Binary, Hex and Decimal Converter and choose its base. It shows the binary, octal, decimal and hex values together.

Try it now

Use the free Binary, Hex and Decimal Converter to do the calculation for you. It runs in your browser and needs no sign-up.

More guides

📖

How to Calculate Percentage

Almost every percentage question uses one of three formulas.

📖

How to Calculate Mean, Median and Mode

These three numbers each describe the centre of a list in a different way.

📖

How to Calculate Your Age

Your age in years is easy.

📖

How to Calculate Days Between Two Dates

Counting days between dates is useful for deadlines, notice periods, pregnancies and projects.

ToolsWorld

Free online tools that run privately in your browser. No sign-up.

Categories

Text toolsImage toolsFinance toolsHealth toolsEducation toolsCalculators toolsDeveloper toolsEveryday tools

Popular tools

Word CounterQR Code GeneratorImage CompressorLoan EMI CalculatorBMI Calculator

Site

About ToolsWorldContact ToolsWorldPrivacy PolicyTerms of UseGuidesاردوالعربية

© 2026 ToolsWorld