Skip to content
devtoolbox.cc

Number Base Converter (Binary, Octal, Decimal, Hex)

Convert numbers between binary, octal, decimal, hexadecimal and any base 2–36. Arbitrary precision and two's complement view.

Runs locally in your browser

Converting between number bases

Computers work in binary (base 2), while developers often read hexadecimal (base 16) for memory addresses, colors and byte values, and octal (base 8) for Unix file permissions. This converter keeps all representations in sync. Edit any field and the others update immediately.

  • Prefixes like 0b, 0o and 0x are accepted, and so are _ or space separators (1111_0000).
  • Numbers can be arbitrarily large and negative, because the tool uses JavaScript BigInt so precision is never lost.
  • Use custom base for anything from base 2 to base 36.

Two’s complement

Signed integers are stored in two’s complement. The panel shows the exact bit pattern of a number in 8, 16, 32 or 64 bits. For example, -1 in 8 bits is 11111111 (0xff).