Number Converter

Type in any field and the other three follow. Works with integers of any size, including negatives.

Decimal base 10
Hexadecimal base 16
Binary base 2
Octal base 8
Two's complementbit pattern for fixed-width integers
WidthHexBinarySignedUnsigned

About number bases

  • Decimal (base 10) uses digits 0–9. Binary (base 2) uses 0 and 1; each digit is one bit. Octal (base 8) uses 0–7; one digit is three bits, as in Unix permissions like 755. Hexadecimal (base 16) uses 0–9 and A–F; one digit is four bits (a nibble), two digits are a byte.
  • Prefixes 0x, 0b and 0o are accepted, as are spaces and underscores used as digit separators (1111_0000).
  • Negative numbers are shown with a minus sign in every base. The two's complement table shows how a fixed-width signed integer stores the value; a pattern such as FF reads as 255 unsigned or −1 as a signed byte.
  • All arithmetic uses JavaScript BigInt, so there is no precision loss for large values.

Privacy

Everything is computed in your browser. Nothing is sent, stored or logged.