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.
Type in any field. Decimal accepts negative numbers; binary and hex are raw bit patterns.
Bit pattern (8 bits)
11010110
0xD6Signed 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
- Choose a bit width: 8, 16, 32, 64 or arbitrary.
- Type a value in the binary, hex or decimal field; the others update.
- Negative decimals are shown in two's complement.
- 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.
Related tools
- Number Base ConverterConvert integers between bases 2, 8, 10, 16 and any up to 36.
- Byte Size ConverterConvert between bytes, KB, MB, GB, KiB, MiB, GiB and more.
- Hash GeneratorSHA-256, SHA-384 and SHA-512 hashes of text or files.
More in Date & Conversion.