PRACTICAL DIGITAL TOOLS
Number base converter.
Convert integers exactly between binary, octal, decimal, hexadecimal and bases 2–36.
255 in base 10 = FF in base 16
Exact integers, in the base you need.
Choose the input and output bases, then type an integer. Results update instantly. Binary uses 0–1, octal 0–7, decimal 0–9, and hexadecimal 0–9 and A–F. Bases above 16 continue through Z.
How the conversion works
Each input digit is multiplied by its positional power of the input base. The integer is then written in the output base. For example, FF in base 16 = 15 × 16 + 15 = 255 in decimal = 11111111 in binary.
This converter uses integer arithmetic to preserve every digit, including integers above JavaScript’s ordinary safe-integer range. It accepts up to 256 digits, negative integers and leading zeros. Fractions, 0x/0b prefixes and two’s-complement interpretation are not supported. Negative results use a minus sign.
Reference: MDN BigInt integer arithmetic.