Text & Developer tool

Number System Converter: Binary, Hex, Octal

Convert between binary, octal, decimal and hexadecimal in one place.

  • Instant results
  • Working shown
  • No sign-up
  • Runs in your browser
ToolUpdates as you type
  • Binary (base 2)1111 1111
  • Octal (base 8)377
  • Decimal (base 10)255
  • Hexadecimal (base 16)FF
How it works

This number system converter reads a whole number in base 2, 8, 10 or 16 and shows it in all four bases at once. For example, decimal 255 is 11111111 in binary, 377 in octal and FF in hexadecimal. It rejects digits that do not belong to the base you picked.

This number system converter changes a number between the four bases you meet in computer science: binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Type the number once and read all four answers together.

How to use the number system converter

  1. Pick the base of the number you have: Binary, Octal, Decimal or Hexadecimal.
  2. Type the number. Spaces, underscores and a 0b, 0o or 0x prefix are fine.
  3. Read the value in every base. Use Copy next to the one you need.
  4. For a non-decimal input, the place value working below shows how the decimal value was found.

When you switch the input base, the current number is converted for you, so nothing is lost.

The four number systems

System Base Digits used Example (value 255)
Binary 2 0, 1 11111111
Octal 8 0 to 7 377
Decimal 10 0 to 9 255
Hexadecimal 16 0 to 9, A to F FF

Number system conversion formula

Value = Sum of (Digit × Base^position)

Position 0 is the rightmost digit. For hexadecimal, A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.

Example, hex 2F to decimal: 2 × 16 + 15 × 1 = 47.

Decimal to binary, octal and hex

Divide by the new base again and again, and write the remainders. Read them from bottom to top.

Step 156 ÷ 16 9 ÷ 16
Quotient 9 0
Remainder 12 (C) 9

Reading from the bottom: 156 in hex is 9C. The same method with 2 gives 10011100, and with 8 gives 234.

Common mistake: A common mistake is reading the remainders from top to bottom. That would give C9 here. The last remainder is the leftmost digit.

Shortcut between binary, octal and hex

Since 8 = 2³ and 16 = 2⁴, you can skip decimal:

  • Binary to hex: group bits in fours from the right. 1001 1100 is 9 C, so 9C.
  • Binary to octal: group bits in threes from the right. 10 011 100 is 2 3 4, so 234.
  • Hex to binary: write each hex digit as 4 bits. F3 is 1111 0011.

This is why programmers use hex for memory addresses and colours. Two hex digits are exactly one byte.

Where you will use this

Pro tip: Remember that hex F is binary 1111 and hex 8 is binary 1000. With those two, you can work out most other hex digits in your head.

This converter handles whole numbers up to 200 digits exactly. To convert text characters into bits instead of numbers, use the text to binary converter.

Frequently asked questions

How do I convert hexadecimal to decimal?
Multiply each hex digit by a power of 16 and add. A to F stand for 10 to 15. For 1A: 1 × 16 + 10 × 1 = 26.
How do I convert binary to hexadecimal quickly?
Group the bits in fours from the right and turn each group into one hex digit. 1010 1111 becomes A F, so the answer is AF. For octal, group the bits in threes.
Why does the converter say my number is invalid?
Each base allows only some digits. Binary allows 0 and 1, octal 0 to 7, decimal 0 to 9, and hexadecimal 0 to 9 plus A to F. A 2 in a binary number or an 8 in an octal number is an error.
Can it convert fractions or negative numbers?
It converts whole numbers. A minus sign is kept as a sign, not turned into two's complement. For binary fractions, use the binary to decimal converter, which handles digits after the point.
Can I type prefixes like 0x or 0b?
Yes. 0b for binary, 0o for octal and 0x for hexadecimal are removed before converting. Spaces and underscores are ignored, so 1111_0000 works too.

Try another tool

See all free tools
Chat with us