Number Base Converter

Convert numbers between decimal, binary, hex and octal.

Converting between number systems

Decimal uses ten digits, binary uses two, octal uses eight and hexadecimal uses sixteen (0 to 9 and A to F). Programmers use them because binary matches how hardware stores data and hexadecimal is a compact way to write it.

Worked example

The decimal number 255 is 11111111 in binary, 377 in octal and FF in hexadecimal. To check hexadecimal FF, calculate 15 ร— 16 + 15 = 255.

How to convert by hand

To convert decimal to another base, divide repeatedly by the base and read the remainders from last to first. To convert back, multiply each digit by the base raised to its position and add.

Where you see them

  • Hexadecimal colours in web design
  • Memory addresses and file permissions
  • Binary flags in programming
Share this tool: