Number Base Converter - Binary, Octal, Decimal, Hex
—————Convert Between Any Number Bases
Type a number, choose the base it is written in, and the converter shows it in binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) at once, plus one custom base you pick from 2 to 36. Results update as you type and each one has its own copy button.
Values are held as arbitrary-precision integers, so large IDs, 64-bit masks and cryptographic numbers convert without rounding. Need one direction only? There are focused pages for binary to decimal, decimal to binary, hex to decimal and decimal to hex.
How Positional Number Systems Work
In any base b, each digit is multiplied by a power of b that depends on its position, counting from 0 on the right. The decimal number 347 means 3 × 10² + 4 × 10¹ + 7 × 10⁰. The same rule applies in every base; only the multiplier changes. To convert into a base, you go the other way: divide by the base repeatedly and collect the remainders.
Worked Example: 2024 in Five Bases
- Hex: 2024 ÷ 16 = 126 r 8, 126 ÷ 16 = 7 r 14 (E), 7 ÷ 16 = 0 r 7. Read upwards:
7E8. - Binary: write each hex digit as four bits: 7 = 0111, E = 1110, 8 = 1000, giving
111 1110 1000. - Octal: regroup the bits in threes from the right: 011 111 101 000 =
3750. - Base 36: 2024 ÷ 36 = 56 r 8, 56 ÷ 36 = 1 r 20 (K), giving
1K8.
The shortcut between binary, octal and hex works because 8 and 16 are powers of 2: one octal digit is exactly three bits and one hex digit is exactly four.
Common Values in Each Base
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 31 | 11111 | 37 | 1F |
| 32 | 100000 | 40 | 20 |
| 63 | 111111 | 77 | 3F |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 127 | 1111111 | 177 | 7F |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1000 | 1111101000 | 1750 | 3E8 |
Exact Results for Large Numbers
Converters built on ordinary JavaScript numbers hold integers exactly
only up to 9,007,199,254,740,991 (253 − 1), and Excel
keeps just 15 significant digits. Beyond that the last digits are
silently rounded, so a 64-bit hex value such as
FFFFFFFFFFFFFFFF comes back as 18446744073709552000
instead of 18446744073709551615. This converter
reads digits one at a time into an arbitrary-precision integer, so
results stay exact whether you paste a Snowflake ID, a 128-bit UUID in
hex or a 2048-bit RSA modulus. The bit count shown under the results
tells you how wide a field you need to store the value.
Where Each Base Is Used
Binary describes bits, flags and network masks. Octal survives mainly in
Unix file permissions such as chmod 755. Hexadecimal is the
compact way to write bytes: colours like #FF8800, memory
addresses, hashes and Unicode code points. Base 36 packs numbers into
short alphanumeric IDs, as used by some URL shorteners. To convert text
rather than numbers, use the hex to text
converter.
Related Tools
JWT Decoder
Decode JSON Web Tokens and inspect header, payload and signature.
Base64 Encode / Decode
Encode text to Base64 or decode Base64 strings back to plain text.
URL Encode / Decode
Percent-encode or decode URLs and query-string parameters safely.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.