Skip to content
appsriha apps

Number Base Converter

Binary · octal · decimal · hex & two's complement

Type in any field and the others update. Negative numbers (-), prefixes (0b·0o·0x), and space or underscore separators are allowed.

Binary0b
Octal0o
Decimal
Hexadecimal0x

Two's complement (fixed width)

Negative numbers are shown as their two's complement pattern; a positive number with the top bit set reads as negative when signed.

How to use Number Base Converter

  • Type a number into any field (binary, octal, decimal, hex or a custom base) and the others update instantly.
  • Prefixes 0b, 0o and 0x, negative numbers, and space or underscore separators are accepted, and very large numbers convert exactly.
  • Pick a bit width below to see the two's complement bit pattern and its signed and unsigned values.

Frequently asked questions

Which bases can I convert between?

There are fields for binary, octal, decimal and hexadecimal plus a custom field for any base from 2 to 36, and typing in any of them updates the rest. For example, decimal 255 is binary 1111 1111, octal 377 and hex FF, and ZZ in base 36 is decimal 1,295.

Are very large numbers converted exactly?

Yes. Calculations use JavaScript BigInt, so there is no rounding within the 1,024-digit limit. Decimal 12345678901234567890 becomes hex AB54 A98C EB1F 0AD2, and the 64-bit maximum 18446744073709551615 is FFFF FFFF FFFF FFFF.

How are negative numbers and two's complement shown?

Each base field shows the sign, like -2A, and choosing a bit width under Two's complement shows the bit pattern. -42 is 1101 0110 in 8 bits (hex D6, unsigned 214) and FFFF FFD6 in 32 bits. Conversely, 200 read as a signed 8-bit value is -56, and values out of range such as 300 are reported as not fitting.

Can the input include a 0x prefix or spaces?

Yes. The 0b prefix in the binary field, 0o in octal and 0x in hex are accepted in any case, and spaces, underscores and commas are treated as digit separators and ignored. A character that does not exist in that base is reported, for example '2' in 102 in the binary field.