Skip to content

Number Base Converter

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

Last updated August 26, 2026

Math & Units

About this tool

Programmers regularly need to move numbers between binary (base 2, how computers store data), octal (base 8), decimal (base 10, everyday counting), and hexadecimal (base 16, used for memory addresses and color codes). This tool converts a number between all four bases simultaneously and live — edit any field and the others update instantly — using arbitrary-precision integers so very large numbers convert correctly.

The number 255 in each base

BaseValue
Binary (base 2)11111111
Octal (base 8)377
Decimal (base 10)255
Hexadecimal (base 16)ff

Code examples

The second line (where shown) is the inverse operation.

LanguageCode
JavaScript(255).toString(16)parseInt('ff', 16)
Pythonhex(255)int('ff', 16)
Shellprintf '%x\n' 255echo $((16#ff))

Frequently asked questions

Why does hexadecimal use letters a–f?

Hex is base 16 but our number system only has 10 digits (0–9), so letters a through f represent the values 10 through 15 to give each of the 16 possible digit values its own symbol.

Is there a limit to how large a number this can convert?

No practical limit — it uses JavaScript's BigInt type internally, so it correctly handles integers far larger than the ~9 quadrillion safe-integer limit of ordinary JavaScript numbers.