Binary, Decimal & Hex Converter

Convert a whole number between binary, octal, decimal and hexadecimal. Choose the base you are typing in and see the other bases at once.

How number bases work

We normally write numbers in base 10, where each position is a power of 10. Computers use base 2 (binary) because a circuit is either off (0) or on (1). Hexadecimal (base 16) is a compact way to write binary: one hex digit equals exactly four bits.

To convert from another base to decimal, multiply each digit by the base raised to its position and add: 2F in hex is 2 × 16 + 15 = 47. To go from decimal to another base, divide repeatedly by the base and read the remainders from last to first.

Examples: 255 = 11111111 in binary = 377 in octal = FF in hex. Colors on the web use hex, such as #FF8800, where FF, 88 and 00 are the red, green and blue values.

This tool uses arbitrary-size integers, so it stays exact with very long numbers. Prefixes like 0x, 0b and 0o are accepted for hex, binary and octal.

How to use it

  1. Pick the base of the number you will type (binary, octal, decimal, hex or another).
  2. Type the number.
  3. Read the same value in binary, octal, decimal and hexadecimal.

Frequently asked questions

How do I convert binary to decimal?

Each binary digit is a power of 2, starting from the right. For example 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11.

What are the digits of hexadecimal?

Hexadecimal uses 0–9 and A–F, where A is 10 and F is 15. So FF = 255 and 10 in hex = 16.

More free tools