Skip to content
Calciyums

Number Base Converter

Convert between binary, octal, decimal and hexadecimal number systems.

Developer

Input

Use only characters valid in the base you chose; a “0x”, “0b” or “0o” prefix, if you type one, is ignored.

Calculated in your browser; what you enter is never sent to a server.

Result

Decimal

255

Binary
11111111
Octal
377
Hexadecimal
FF

How does it work?

The Number Base Converter takes a number in whichever base you specify (binary, octal, decimal or hexadecimal) and shows the same value in the other three. The conversion works by reading the number as a big integer first and then rewriting it in each target base, so even very long numbers beyond JavaScript's normal safe integer limit convert without losing precision. A prefix like '0x', '0b' or '0o' is ignored if you type one — you can enter the number with or without it. Example: choose Decimal as the base and enter 255, and the tool shows it as 11111111 in binary, 377 in octal and FF in hexadecimal — since 255 = 2⁷+2⁶+...+2⁰, its binary form is eight 1s. Use this tool to find the decimal value behind a color hex code, inspect an IP address or subnet mask in binary, check a base-conversion homework problem for a programming class, or see which bits are set in a bitmask.

Example

Which base?: Decimal (base 10) · Number: 255 → Decimal: 255

Similar Tools

Toolbox Get your Toolbox ready.

Star the tools you use most and, with an account, they follow you to every device.

Create account

Frequently asked questions

Can I convert negative numbers?

No, this tool only works with non-negative whole numbers (0 and above).

What if I type a prefix like 0x or 0b?

It's ignored; you can type the number with or without its usual prefix.

Can I convert decimals with a fractional part?

No, this tool only works with whole numbers.

Will a very large number lose precision?

No. The number is converted using integer arithmetic, not floating-point, so it comes out exact no matter how long it is.

Does the case of the letters matter for hex?

No, both are accepted — 'ff' and 'FF' are read the same way, though the result is always shown in uppercase.