All free tools

Number base converter: binary, octal, decimal and hex

Type a number in any base and see it in binary, octal, decimal, hex and a base of your choice, plus its two’s complement bit pattern.

Runs in your browser. Nothing you type is sent to EpiFive.

Type in any box. Spaces, underscores and the 0x, 0o and 0b prefixes are fine.

Bits needed8
Bytes1
Decimal digits3

Two’s complement (signed integers)

Bits1111 1111
Hex0xFF
As signed-1
As unsigned255

How to use it

  1. Type in any box: binary, octal, decimal, hex or the other base you pick. The rest update as you type.
  2. Tick Group digits for readable groups such as 1111 1111, and choose upper or lower case letters.
  3. Under Two’s complement, choose a width to see the bit pattern a computer stores, and its signed and unsigned values.
  4. Use Copy to copy a value; binary, octal and hex can be copied with their 0b, 0o or 0x prefix.

Quick reference

  • 255 = 0xFF = 0o377 = 0b11111111
  • 1024 = 0x400 = 0b10000000000
  • −1 at 32 bits = 0xFFFFFFFF
  • Subnet calculator: Network, mask, broadcast, host range and Azure usable hosts for any IPv4 CIDR, and split ranges into subnets.
  • Color converter: Convert HEX, RGB and HSL with alpha, and check text and background contrast against WCAG AA and AAA.
  • Unicode character inspector: Code points, UTF-8 bytes and escapes for every character, plus zero-width, bidi and lookalike letters.
  • Unit converter: Convert length, weight, temperature and data sizes (KB, MB, GB in both 1000 and 1024).
  • Hash generator: MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files, and checksum verification.

Questions people ask

How do I convert decimal to binary?

Divide by 2 again and again and write down the remainders, then read them from last to first. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, so 13 is 1101. Type a number in the decimal box and every other base updates at once.

How do I convert hex to decimal?

Multiply each hex digit by a power of 16, starting from the right. 0x1F is 1 × 16 + 15 = 31, and 0xFF is 15 × 16 + 15 = 255. The letters A to F stand for 10 to 15.

What is two’s complement?

It is how computers store negative whole numbers. To get −x at a fixed width, invert all the bits of x and add 1. At 8 bits, −1 is 11111111 (0xFF) and −128 is 10000000. The same bit pattern reads as 255 if the type is unsigned, which is why the tool shows both readings.

Is there a size limit?

No practical limit. The converter uses arbitrary-precision integers (BigInt), so 64-bit, 128-bit and longer values convert exactly, unlike calculators that lose digits past about 16 decimal places.

Can I paste numbers with 0x, spaces or underscores?

Yes. Prefixes such as 0x, 0o and 0b, spaces, underscores and commas are ignored, so 0xFF_FF, 1111 0000 and 1,000,000 all work. Fractions are not supported; only whole numbers.