Number Base Converter

Convert a number between binary, octal, decimal and hexadecimal in real time. Pick the base you are typing in and all four representations update together. An optional bit width (8, 16, 32 or 64) pads the binary output and shows the signed two's-complement value, which helps when working with masks, registers and protocol fields.

How to use

  1. Select the input base: binary, octal, decimal or hexadecimal.
  2. Type the number; prefixes such as 0b, 0o and 0x and underscore separators are accepted.
  3. Optionally choose a bit width of 8, 16, 32 or 64 bits to pad the binary value and see its signed interpretation.
  4. Copy any of the four results with its Copy button.

Example

Input

Input base: hexadecimal · Value: 0xFF · Bit width: 8

Output

Binary:      11111111
Octal:       377
Decimal:     255
Hexadecimal: FF
Signed 8-bit: -1

Frequently asked questions

How do I convert hexadecimal to decimal?

Select hexadecimal as the input base and type the value, with or without the 0x prefix. The decimal result, along with binary and octal, appears immediately.

Can it handle very large numbers?

Yes. Conversions use JavaScript BigInt, so values beyond 2^53 stay exact, with no rounding.

What does the bit width option do?

It limits the value to 8, 16, 32 or 64 bits, pads the binary output with leading zeros and shows how the same bits read as a signed two's-complement number. A value that does not fit in the chosen width is reported as an overflow.

Is my input sent anywhere?

No. All conversions happen locally in your browser.

Related tools