How to convert between number bases
- Choose the base your number is written in: binary, octal, decimal, hex, or Other for any base from 2 to 36.
- Type or paste the number. Prefixes such as
0x,0b, and0oare accepted, and so are spaces and underscores between digits. - Read the result in binary, octal, decimal, and hex, or open the list of other bases. Press the copy button next to any row.
For bases above 10, letters stand for digits: A is 10, B is 11, up to Z for 35. Pick a bit width under two’s complement to see how a number is stored in 8, 16, 32, or 64 bits.
Questions
Is my number sent anywhere?
No. The conversion is done by your browser, so nothing is uploaded or stored.
How large a number can it convert?
Any size you can paste, up to 20,000 digits. The tool uses BigInt, so there is no rounding, unlike a calculator that stores numbers as floating point after about 16 digits.
How do I convert binary to decimal, or decimal to hex?
Pick the base your number is written in under "Number is written in", then type the number. Every other base appears at once, so one entry gives you binary to decimal, decimal to hex, hex to binary, and the rest.
What is two's complement?
It is the way computers store negative whole numbers. To negate a number, flip all of its bits and add one. In 8 bits, -1 is 11111111 and -128 is 10000000. Choose a bit width to see the pattern for your number, and how the same bits read as signed and unsigned.
Does it support fractions or negative numbers?
Negative whole numbers work in every base, shown with a minus sign. Fractions such as 0.1 are not supported; only whole numbers are converted.
Credits
Built by OneTooling using standard browser features. No third-party code runs on your data.