Number Base Converter
Convert integers between binary, octal, decimal, and hexadecimal.
Last updated August 26, 2026
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
| Base | Value |
|---|---|
| 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.
| Language | Code |
|---|---|
| JavaScript | (255).toString(16)parseInt('ff', 16) |
| Python | hex(255)int('ff', 16) |
| Shell | printf '%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.
More in Math & Units
Convert length, weight, and temperature between common units.
Calculate Body Mass Index from height and weight, metric or imperial.
Calculate any percentage instantly. Find X% of Y, what percentage one number is of another, the whole value, or the percentage change between two numbers.