Simple tools for everyday life.

Number Base Converter

Convert between binary, octal, decimal and hexadecimal.

Tip: Binary = base 2 (computers), octal = base 8, decimal = base 10, hex = base 16.

Loading tool…

Did this tool help?

About this digital tool

The number base converter turns a number between the binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) systems. Enter the number, choose the source base and the target base and the result appears instantly. If the number contains digits that don't belong to the chosen base, you get an error notice.

In every base, each digit has a value according to a power of the base. For example, binary 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11 in decimal. The number 255 in decimal is 11111111 in binary, 377 in octal and FF in hexadecimal. It is used in computing, programming, networking (IP addresses), web colours (#FF0000) and digital electronics.

How to use

  1. Enter the number you want to convert in the "Number" field.
  2. Choose the source base (Binary, Octal, Decimal or Hex).
  3. Choose the target base you want.
  4. Read the result; if an error appears, check that the digits belong to the source base.

Frequently asked questions

Why is hexadecimal used in programming?

Each hex digit represents exactly 4 binary bits, making it more compact than binary. E.g. #FF0000 (the colour red) = 11111111 00000000 00000000 in binary.

How do I convert a binary number to decimal?

Add the powers of 2 where there is a 1 digit. E.g. 1011 = 8 + 2 + 1 = 11. Just choose From: Binary, To: Decimal and enter 1011.

How do I convert a decimal number to binary?

Divide repeatedly by 2 and read the remainders from the end. E.g. 13 = 8 + 4 + 1, so 1101 in binary.

What is FF in hexadecimal?

FF = 15 × 16 + 15 = 255 in decimal. The letters A-F represent the values 10-15, so 2A = 2 × 16 + 10 = 42.