How it works
The input is read digit by digit in the source base (value = value × base + digit) into an arbitrary-precision integer, so there is no rounding even for hundreds of digits. It is then written out in the target base by repeated division.
The result lists binary, octal, decimal and hexadecimal side by side, grouped for easier reading, along with the bit and byte length. For negative numbers the two’s-complement bit pattern is shown for 8, 16, 32 and 64 bits where it fits.
Digits in bases above 10
After 0–9 the letters continue the digits: A = 10, B = 11 … F = 15 in hexadecimal, up to Z = 35 in base 36. Upper and lower case mean the same.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
Tips
- One hex digit is exactly four bits and one octal digit is three, which is why programmers use them as shorthand for binary.
- Unix file permissions such as 755 are octal: 7 = rwx, 5 = r-x.
- Base 36 (0–9 plus A–Z) is handy for short IDs: 1,000,000 is LFLS.
Standards and sources
- ECMAScript Language Specification: BigInt · Ecma International (TC39)
- ECMAScript Language Specification: Number.prototype.toString(radix) · Ecma International
Last reviewed October 17, 2026
Frequently asked questions
How do I convert decimal to binary?
Divide by 2 repeatedly and read the remainders from last to first. 13 ÷ 2 gives remainders 1, 0, 1, 1, so 13 is 1101. The converter does this instantly for any size.
How do I convert hex to decimal?
Multiply each digit by a power of 16 and add them up. FF = 15 × 16 + 15 = 255.
Is there a size limit?
Numbers are handled with JavaScript BigInt, so there is no precision limit. To keep the page responsive, input is capped at 4,096 digits.
Can it convert fractions?
No, it converts whole numbers only. Fractional parts often do not end in another base (0.1 in decimal repeats forever in binary).