Number Base Converter
Type a number in any base and read it in all the others, however large.
Two's complement (8, 16, 32 and 64 bits)
The same bits mean different numbers depending on whether a program reads them as signed or unsigned.
How to use the Number Base Converter
- Type or paste a number into the binary, octal, decimal, hexadecimal or custom base field. Prefixes such as 0x and digit groups with spaces are fine.
- The other four fields update as you type. Pick any base from 2 to 36 for the custom field.
- Read the bit length, the smallest signed width and the byte count on the right, and open the two's complement section for 8, 16, 32 and 64-bit patterns.
- Use the copy button next to a field to grab the plain digits, with or without a 0b, 0o or 0x prefix.
About this tool
Programmers meet the same number in several costumes: a file permission in octal, a colour or memory address in hexadecimal, a flag mask in binary, and the plain decimal everyone else uses. This converter keeps all of them in sync. Whatever field you type in becomes the source, and the others are rewritten instantly, with digits grouped in fours or threes so long values stay readable. A fifth field converts to or from any base between 2 and 36, which covers base 32 identifiers, base 36 short codes and classroom exercises alike.
Arithmetic is done with BigInt, so there is no 53-bit ceiling: a 256-bit hash or a 4096-bit key converts just as happily as the number 42. Negative numbers are shown as a sign in front of the magnitude in every base, and the details panel reports how many bits the value needs, both as an unsigned number and in two's complement form. The two's complement section goes further and shows the exact 8, 16, 32 and 64-bit patterns, together with what each pattern means when read back as signed or unsigned, which is the usual source of "why is my byte negative" confusion.
Tip: paste a value straight from a debugger or a spec. Underscores, commas, apostrophes and spaces between digits are ignored, and a lowercase or uppercase 0x prefix is understood in the hexadecimal field.
Frequently asked questions
Does the number I type get sent anywhere?
No. The conversion is a few lines of JavaScript running in this page. The last value is remembered in your own browser so it is still there when you come back, and nothing else is stored.
How large a number can it convert?
Up to 20,000 digits in any base, which is far beyond 64-bit integers. The page uses BigInt arithmetic, so the result is exact rather than rounded.
How are negative numbers handled?
In the main fields a negative value is written as a minus sign followed by the magnitude, for example -FF in hexadecimal. To see how a computer actually stores it, open the two's complement section, where -255 in 16 bits appears as FF01.
Why does the two's complement section say a value does not fit?
An 8-bit pattern can hold -128 to 255 depending on how it is read, 16 bits hold -32,768 to 65,535, and so on. If your number is outside that span for a given width, there is no pattern of that size for it, and the section tells you how many bits it needs instead.
Can I convert fractions or decimals with a point?
Not here. The tool converts whole numbers only, because fractional values in other bases are rarely needed and are easy to misread. A decimal point produces a clear message instead of a wrong answer.