How this number base converter works
Every number you write is stored in a positional system: each digit is worth a power of the base, depending on where it sits. In decimal (base 10) the number 255 means 2×10² + 5×10¹ + 5×10⁰. Change the base and the same idea applies with a different multiplier — binary uses powers of 2, hexadecimal uses powers of 16.
To convert, this tool first reads your input in its source base, building up the exact value by multiplying each digit by the base and adding the next digit. It then converts that value to the target base by repeated division: divide by the target base, keep the remainder as a digit, and repeat until nothing is left, reading the remainders backwards. Letter digits A–Z cover values 10–35, and hexadecimal output is shown in uppercase.
Reference note: this converter handles whole numbers only and uses BigInt arithmetic, so arbitrarily large integers convert exactly without the rounding errors ordinary JavaScript numbers would introduce above 253. A leading minus sign is accepted for negative integers.
Example conversions
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 42 | 101010 | 52 | 2A |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1000 | 1111101000 | 1750 | 3E8 |
Frequently asked questions
- What is a number base?
- A number base, or radix, is how many distinct digits a positional system uses. Base 10 uses 0–9; base 2 uses only 0 and 1. Each position is worth the base raised to a power, so in base 10 the places are ones, tens, hundreds, and so on.
- How do I convert between bases?
- Read the source number as a value by multiplying each digit by the base raised to its position, then repeatedly divide that value by the target base and collect the remainders, which become the new digits read from last to first. This tool does both steps instantly.
- What is hexadecimal?
- Hexadecimal is base 16. It uses 0–9 plus A–F for the values 10 through 15. Each hex digit maps to exactly four binary digits, so one byte is two hex digits — for example 255 in decimal is FF in hex.
- What bases are supported?
- Any base from 2 to 36 for both source and target. Bases up to 36 use 0–9 then A–Z, giving 36 symbols. Letter digits are case-insensitive on input and shown in uppercase on output.
- Why use BigInt for large numbers?
- Ordinary JavaScript numbers lose precision above 2⁵³, so long binary or big hex values would round wrongly. This converter uses BigInt arithmetic, which handles arbitrarily large whole numbers exactly, with no rounding errors.
- What is base 36?
- Base 36 is the largest base in the standard alphanumeric set: ten digits 0–9 plus twenty-six letters A–Z, for 36 symbols. It gives the shortest letter-and-number representations, handy for compact IDs and short codes.