Number Base Converter
Convert whole numbers between binary, octal, decimal and hexadecimal, with all four bases shown at once.
Convert a whole number
Negative values are supported. A 0b, 0o or 0x prefix is accepted and removed.
Spaces and underscores between digits are ignored.
Value in Hexadecimal
FF
Base 16, written with the 0x prefix in code
In every base
The same value written in all four bases.
Binary
Grouped: 1111 1111
11111111 (base 2)
Octal
377 (base 8)
Decimal
255 (base 10)
Hexadecimal
FF (base 16)
Bits needed
In binary
8
Digits in this base
As you typed it, without a prefix
3
How it is calculated
Binary = base 2 (0 and 1) Octal = base 8 (0 to 7) Decimal = base 10 (0 to 9) Hex = base 16 (0 to 9 and A to F)
Conversion is done with BigInt, so long values keep every digit instead of losing the end to rounding.
How to use Number Base Converter
- 1Type a whole number - a 0b, 0o or 0x prefix is accepted and removed.
- 2Choose the base the number is written in, and the base you want it in.
- 3Read the converted value, then every other base beside it.
- 4Press the copy button beside any base to take that value.
Frequently asked questions
How long a number can I convert?
Up to 200 digits. Conversion uses BigInt, so every digit is kept exactly instead of the end of a long binary number drifting through floating point rounding.
Are negative numbers supported?
Yes, with a minus sign in front. Binary, octal and hexadecimal are written with the sign outside the digits rather than as a two's complement pattern, which is what most calculators do.
Related tools
More calculators you might find useful.
Scientific Calculator
A full scientific calculator with brackets, powers, roots, trigonometry, logarithms, factorials and constants.
Open toolAverage Calculator
Paste a list of numbers to get the average, median, mode, minimum, maximum, sum and range in one go.
Open toolPercentage Calculator
Work out a percentage of a number, what share one number is of another, and percentage increases or decreases.
Open tool