Skip to content
DevKOM

Binary / Hex / Decimal Converter

A programmer's converter for fixed-width integers. Enter binary, hex or decimal and see the signed and unsigned values, the two's-complement bit pattern and the bytes, for 8, 16, 32 or 64 bits.

Bit width

Type in any field. Decimal accepts negative numbers; binary and hex are raw bit patterns.

Bit pattern (8 bits)

11010110
0xD6
Signed decimal
two's complement
-42
Unsigned decimal
214
Hex
0xD6
Octal
0o326
Bytes (big-endian)
D6
Bytes (little-endian)
D6
Ranges: 8-bit signed −128…127 (unsigned 0…255), 16-bit −32,768…32,767, 32-bit −2,147,483,648…2,147,483,647, 64-bit ±9.22 × 10¹⁸. Values are exact at every size because the converter uses BigInt instead of JavaScript's 53-bit floating-point numbers.

How to convert binary, hex and decimal

  1. Choose a bit width: 8, 16, 32, 64 or arbitrary.
  2. Type a value in the binary, hex or decimal field; the others update.
  3. Negative decimals are shown in two's complement.
  4. Copy any representation.

Frequently asked questions

What is two's complement?

The way computers store negative integers. For a given width, -x is stored as 2^width - x, so -1 in 8 bits is 11111111 (0xFF). The highest bit acts as the sign bit.

What happens if a value doesn't fit the bit width?

DevKOM shows an overflow error instead of silently wrapping it. Choose a larger width or Arbitrary.

More in Date & Conversion.