Number Base Converter

Convert numbers between Binary, Octal, Decimal, Hexadecimal, and custom bases

Input

Binary0b
Octal0o
Decimalno prefix
Hexadecimal0x

About Number Bases

Common Bases

  • Binary (2): Used in computing — only 0 and 1
  • Octal (8): Digits 0–7, used in Unix permissions
  • Decimal (10): Standard everyday number system
  • Hex (16): Digits 0–9 + A–F, used in colors and memory

Two's Complement

Two's complement is the standard way to represent negative integers in binary. For a negative number, take the positive binary representation and compute 2^n minus the value, where n is the bit width. The MSB (leftmost bit) is 1 for negative numbers.