Number Base Converter: Binary, Octal, Decimal, Hex

  • Free
  • No sign-up
  • Runs in your browser
  • Last updated 2026-10-07
Report a problem

Type a number in any base and see it in binary, octal, decimal and hexadecimal, plus a base of your choice.

Everything you enter is processed in your browser and is never sent to a server.

How to use

  1. Type the number. Prefixes 0x, 0b and 0o, a minus sign, spaces and underscores such as 1111_1111 are accepted.
  2. Choose which base the number is written in. Decimal is the default.
  3. Copy the base you need from the list. Set Custom base for any base from 2 to 36.

Examples

255 (decimal)
→ binary 11111111, octal 377, hexadecimal ff
It needs 8 bits, which is one byte.
0xFF (hexadecimal)
→ decimal 255
ffffffffffffffffffff (hexadecimal)
→ decimal 1208925819614629174706175
That is 2^80 - 1, and 80 bits are needed. The result is exact because the tool does not use ordinary floating-point numbers.

How it works

Your digits are read one by one and combined into a whole number as value = value x base + digit, using arbitrary-size integers. A digit that does not belong to the chosen base, such as 2 in binary, is reported by name.

The result is written back with the same standard method in base 2, 8, 10, 16 and your custom base. The bit count is the length of the binary form of the number’s size, with zero counted as 1 bit.

The tool is tested with values such as 255, 0xFF, a negative number and a number of 80 bits.

Sources

Frequently asked questions

Why is hexadecimal used so much?
One hexadecimal digit stands for exactly four bits, so two digits are exactly one byte. That makes long binary values short and easy to read, for example 11111111 is ff.
Are very large numbers exact?
Yes. The tool uses arbitrary-size integers, so there is no rounding. Ordinary JavaScript numbers lose exactness above 9007199254740991 (2^53 - 1), which this tool does not.
How are negative numbers shown?
With a minus sign in front, for example -10 is -1010 in binary. The tool does not show two's complement, which depends on a chosen bit width.
What are bases above 16?
They use the letters a to z after the digits 0 to 9, so base 36 has 36 symbols. Letters are not case sensitive when you type them, and results are written in lower case.
Can I convert fractions?
No. The tool handles whole numbers only.
Is anything sent to a server?
No. The conversion runs in your browser.

Last updated: