Skip to content
Webmaster Tools
Dev utilitiesNumber Base

Binary, Hex & Decimal Converter

Binary, octal, decimal, hex.

Details
bit length
bits set
bytes
signed 32-bit
unsigned 32-bit
Binary, grouped by nibble

      
Runs in your browser

About the Number Base Converter

This tool converts integers between decimal, hexadecimal, binary and octal. Type in any of the four fields and the others update immediately. It uses arbitrary-precision integers (BigInt), so 64-bit and larger values convert exactly, without floating-point rounding.

Input is forgiving: prefixes like 0x, 0b and 0o are accepted in their fields, and spaces, underscores and commas used as digit separators are ignored, so 1111_0000 or 4,294,967,295 work. Negative numbers are written with a leading minus sign. The Details card shows the bit length, the number of bits set (population count), the minimum byte count, how the value reads as a signed and unsigned 32-bit integer, and the binary form grouped into 4-bit nibbles.

How to use it

  1. Type a number into any of the four fields.
  2. Read the converted values in the others, and the Details card.
  3. Use the copy button next to any field.

Examples

Common questions

How do I convert hex to decimal by hand?

Multiply each digit by 16 raised to its position, counting from zero on the right, and add the results: 0x1f is 1 × 16 + 15 = 31.

Why are negative numbers shown with a minus sign?

The main fields show the mathematical value. The 32-bit values in Details show the two's complement interpretation.

Does it support fractions?

No. It converts whole numbers only; a decimal point is rejected as an invalid digit.