Converters

Number base converter

Convert integers between binary, octal, decimal, and hexadecimal.

Loading tool…

  1. 1 Type the number without a 0x or 0b prefix.
  2. 2 Choose the base you typed.
  3. 3 Copy the base you need.
  4. 4 A digit that is illegal in that base shows an error.

How it works

Enter an integer and the base you wrote it in. The page shows binary, octal, decimal, and hexadecimal using BigInt, so values past the usual JavaScript safe integer still convert. Fractions, prefixes such as 0x, and digits that do not belong in the source base are rejected.

Frequently asked questions

Does this handle negative numbers?

Yes. A leading minus is kept in every base.

Why not floating point?

Fractional values in other bases are ambiguous here. The tool is for whole numbers.