Number Base Converter
Convert numbers between binary, octal, decimal and hexadecimal (or any base from 2 to 36), and text to binary or hex.
How to use the number base converter
- Type a whole number in any box: decimal, binary, hexadecimal, octal, or a base of your choice from 2 to 36.
- All the other boxes update as you type. Prefixes such as
0x,0band0o, and spaces or underscores between digits, are fine. - For negative numbers, see the two’s complement form used by computers in 8, 16, 32 and 64 bits.
- Choose Text to turn words into binary or hex bytes, or paste binary or hex to read it as text.
Decimal, binary, octal and hex table
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 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 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 12 | 1100 | C | 14 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
| 32 | 100000 | 20 | 40 |
| 64 | 1000000 | 40 | 100 |
| 100 | 1100100 | 64 | 144 |
| 127 | 1111111 | 7F | 177 |
| 128 | 10000000 | 80 | 200 |
| 255 | 11111111 | FF | 377 |
| 256 | 100000000 | 100 | 400 |
| 1000 | 1111101000 | 3E8 | 1750 |
| 1024 | 10000000000 | 400 | 2000 |
| 65535 | 1111111111111111 | FFFF | 177777 |
Frequently asked questions
How do I convert decimal to binary?
Divide the number by 2 again and again, writing down each remainder, then read the remainders from the last to the first. 13 ÷ 2 = 6 r 1, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, 1 ÷ 2 = 0 r 1, so 13 is 1101 in binary. The converter does this instantly for numbers of any length.
How do I convert binary to decimal?
Each binary digit is worth twice the one to its right: 1, 2, 4, 8, 16 and so on. Add up the values where there is a 1. For 1101 that is 8 + 4 + 0 + 1 = 13.
Why do programmers use hexadecimal?
One hex digit is exactly four binary digits, so a byte (8 bits) is always two hex digits, from 00 to FF. That makes long binary numbers, memory addresses and colours such as #FF8800 much shorter and easier to read.
How are negative numbers shown in binary?
Computers usually store them in two’s complement: flip every bit of the positive number and add 1. In 8 bits, −1 is 11111111 and −128 is 10000000. When you enter a negative number, the converter shows it in 8, 16, 32 and 64-bit two’s complement wherever it fits.
How does text to binary work?
Each character is turned into bytes using UTF-8, and each byte is written as 8 binary digits. "H" is 72, which is 01001000. Letters like é or emoji take two to four bytes. Paste binary or hex in the lower boxes to turn it back into text.
Is there a size limit?
Numbers can be up to 4,000 digits long; the converter uses exact whole-number arithmetic, so even very large numbers are converted without rounding. Fractions (numbers with a decimal point) are not supported.
Related tools
Browse all tools- Color Converter Convert colours between HEX, RGB, HSL, HWB, CMYK and OKLCH, pick from the screen, and check contrast for readable text.
- Base64 Encoder and Decoder Encode text or files to Base64 and decode Base64 back to text or a file, with UTF-8, URL-safe and data URL options.
- Unit Converter Convert between more than 130 units in 14 kinds: length, weight, temperature, volume, area, speed, time, data, pressure, energy, power, fuel economy, angle and frequency.
- Image Converter Convert images between JPG, PNG, WebP, AVIF and ICO, resize them, and download one by one or as a ZIP. Nothing is uploaded.
- CSV to JSON Converter Turn CSV into JSON, or JSON into CSV, with delimiter detection, headers, number types and nested objects flattened. Paste or open a file.