Number Base Converter: Binary, Decimal, Hex and Octal

Convert binary to decimal, decimal to binary, hexadecimal and octal in one place. Type a number in any box and the others update instantly. It handles very large numbers exactly and also converts to any base from 2 to 36.

Everything runs in your browser. Nothing you enter is sent to or stored on our server.

Quick answer: To convert binary to decimal, multiply each digit by its power of 2 and add them up. 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11. To convert decimal to binary, keep dividing by 2 and read the remainders from bottom to top.

How to use the number base converter

Type in any box: decimal, binary, hexadecimal or octal. The others update immediately. Prefixes such as 0x for hex and 0b for binary are accepted, spaces and underscores are ignored, and negative numbers work. Choose Other base for any base from 2 to 36. Large numbers are handled exactly with no rounding.

Binary to decimal, step by step

  1. Write the powers of 2 under each digit from right to left: 1, 2, 4, 8, 16, 32 and so on.
  2. Add the powers where the digit is 1. For 110010: 32 + 16 + 2 = 50.

Decimal to binary, step by step

Divide by 2 and note the remainder until you reach 0. For 13: 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1. Read the remainders upwards: 1101.

Quick reference

DecimalBinaryHexOctal
0000
510155
101010A12
151111F17
16100001020
25511111111FF377
1024100000000004002000

Where each base is used

  • Binary (base 2): how computers store everything, as bits that are on or off.
  • Hexadecimal (base 16): a compact way to write bytes; one hex digit is 4 bits. Used for colors (#FF8800), memory addresses and MAC addresses.
  • Octal (base 8): Unix file permissions such as chmod 755.

To turn text into binary, use the binary translator. For colors, try hex to RGB.

FAQ

What is 255 in binary?

11111111, the largest value in one byte.

Why does hex use letters?

Base 16 needs 16 digits, so A to F stand for 10 to 15.

More free tools

See all of them on the QuickOnlineTips free online tools page and play our free online games.

Found this useful? Share it with someone who needs it.