Skip to content

Number Base Converter

Convert numbers between binary, octal, decimal and hexadecimal.

Converted locally in your browser.

How do you convert a number between binary, decimal and hexadecimal?

A number base converter parses the value from its input base into an integer, then formats it into base 2, 8, 10 and 16 all at once. Only digits valid for the chosen base are accepted. For example, the hex value FF equals 255 in decimal, 11111111 in binary and 377 in octal. This lets developers see every representation instantly.

Understanding your result

Only digits valid for the chosen base are accepted (for example, 2 is not valid binary).

Formula and method

The value is parsed from its input base into an integer, then formatted into base 2, 8, 10 and 16.

Assumptions and limitations

The tool converts whole integers between bases and only accepts digits valid for the chosen input base. It does not handle fractional numbers, negative values, or non-integer notation, and it works on the value's magnitude rather than any two's-complement representation used inside a specific data type.

Worked example

The hex value FF equals 255 in decimal, 11111111 in binary and 377 in octal.

How to use this tool

  1. Enter the value.
  2. Choose the input base.
  3. Read all four representations.

Common mistakes to avoid

  • Entering hex letters while the input base is set to decimal.

About the Number Base Converter

Convert a number from one base to binary, octal, decimal and hexadecimal all at once.

Who should use this tool

Programmers working with bitmasks and flags, embedded developers reading hardware registers, and students learning number systems. Anyone who needs to see a value in binary, octal, decimal, and hexadecimal at once — for example checking a permission bitfield or a hex colour byte.

Benefits

  • Shows binary, octal, decimal and hex simultaneously
  • Rejects digits invalid for the selected base
  • Ideal for inspecting bitmasks and register values
  • Converts locally with no data leaving the browser

Practical use cases

  • Reading a hardware register value written in hex
  • Checking a permission bitmask in binary
  • Converting a hex colour byte to decimal
  • Teaching or learning how number bases relate

Explore all Developer Tools tools

Frequently asked questions

Does it handle large numbers?

It handles standard integers reliably; extremely large values may lose precision.

Why is a digit like 2 rejected when I choose binary?

Binary uses only the digits 0 and 1, so any other digit is invalid input for base 2. Each base allows a fixed set of digits: octal permits 0 to 7, decimal 0 to 9, and hexadecimal 0 to 9 plus A to F. The tool blocks digits outside the chosen base.

Can it convert negative or fractional numbers?

No. This converter works with non-negative whole integers only. It does not accept a minus sign, decimal point, or fractional part, and it does not model two's-complement bit patterns for a specific integer width. For those cases you need a calculator built for signed or fixed-point representations.

Share this tool

Free to use — copy the link, share it anywhere, or add the tool to your own website.

Embed this tool on your site (free)

Copy this code and paste it into any web page — it stays free and always up to date: