Number / Base Converter

Hex ↔ dec ↔ bin ↔ oct with bit width, two's complement and a clickable bit editor.

HEX
DEC
BIN
OCT

Bit width & two's complement

The bit width fixes how many bits hold the value, and any operation wraps within it (so on 8 bits, 0xFF + 1 = 0x00). The same bit pattern reads as two different numbers depending on the interpretation:

That's two's complement: the most-significant bit carries a negative weight, so is 255 unsigned but −1 signed on 8 bits. Negating is "invert all bits and add one." Click any bit above to flip it, or use the shift / rotate / bitwise buttons — every view updates live.