Why it exists
The same integer looks very different depending on context. File permissions such as 755 are octal, colors like #FF6600 are hex, memory addresses show up as 0x7ffd, short links and short IDs use base36, and hardware registers are often written in binary. Converting between them by hand invites mistakes, and JavaScript numbers lose precision past 2 to the 53rd, which corrupts the last digits. This tool uses arbitrary-precision arithmetic, so even hundreds of decimal digits convert exactly.
Steps
Steps
- Choose the source base in the upper select and the target base in the lower one: 2, 8, 10, 16 or 36. To work the other way, click the ⇄ button to swap both selects instead of retyping.
- Type the value. Hex accepts ff, FF or 0xFF, and the 0x prefix is recognized and stripped. For binary, use only 0 and 1 with no spaces or commas.
- Click Convert. On a first visit, Load example shows the expected input format.
- Output carries no leading zeros and no 0x prefix. If you need fixed width, such as eight hex digits, pad on the left yourself.
Base36, negatives and fractions
Base36 uses 0-9 plus a-z for values 0 to 35, case-insensitive on input and lowercase on output. It is popular for compressing numeric IDs because the same value is far shorter than in decimal. Negatives and fractions are unsupported: a minus sign counts as an invalid character and digits after the decimal point are ignored. To handle fractions, split the integer and fractional parts, convert them separately and reassemble, or scale by a power of ten first.
Likely pitfalls
Likely pitfalls
An invalid-character warning means the input holds a digit the chosen base forbids, for example 2 or a in binary, or 8 and 9 in octal. A result off by one digit usually points to the wrong source base, most often a decimal number pasted while binary is selected. Leading zeros also vanish: 007 in octal is simply 7, so pad the output side yourself if you need three-digit octal.