How to convert between bases
- Type a number and choose the base it's written in. Prefixes are understood:
0xfor hex,0bfor binary,0ofor octal. Spaces and underscores used as separators (1111_0000) are ignored. - The same value appears in binary, octal, decimal and hexadecimal, plus one extra base of your choice (2–36).
- Click Copy next to any result.
The converter uses arbitrary-precision integers (JavaScript BigInt), so a 128-bit UUID, a 256-bit hash or a 40-digit decimal number converts exactly — no rounding as with ordinary calculators.
Number bases explained
A base (or radix) is how many different digits a number system uses. Each position is worth the base times the position to its right. In decimal, 255 = 2×100 + 5×10 + 5×1. In binary, the same value is 11111111 = 128+64+32+16+8+4+2+1.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Hexadecimal is popular in computing because one hex digit is exactly 4 bits, so a byte is always two hex digits. Octal survives mainly in Unix file permissions — see the chmod calculator. Base 36 (0–9 plus A–Z) is used for short IDs and URL shorteners.
Negative numbers
Negative numbers are shown with a minus sign in every base (−255 = −FF). Computers usually store negative integers in two's complement form instead, where the bit pattern depends on the integer size (−1 is FF as an 8-bit value but FFFFFFFF as a 32-bit one). To get the two's complement of −N for an n-bit type, convert 2n − N: for −1 in 8 bits, convert 256 − 1 = 255 → 11111111.
Frequently asked questions
How do I convert binary to decimal by hand?
Multiply each digit by its place value (1, 2, 4, 8, 16… from the right) and add them up. 1011 = 8 + 0 + 2 + 1 = 11.
How do I convert decimal to hexadecimal?
Divide by 16 repeatedly and write down the remainders (10–15 become A–F), then read them from last to first. 255 ÷ 16 = 15 remainder 15 → FF.
Is there a size limit?
No practical limit — numbers with thousands of digits convert exactly, because the tool uses arbitrary-precision integers instead of floating point.
Can it convert fractions like 0.1?
No, it converts whole numbers only. Fractions often have no exact representation in another base (0.1 in binary repeats forever).