Number Base Converter
Type a number, choose the base it is written in, and see it in binary, octal, decimal and hexadecimal, with the working shown.
Binary
111 1110 1010Octal
3752Decimal
2,026Hexadecimal
7EAShow the working
| Divide | Quotient | Remainder (digit) |
|---|---|---|
| 2026 ÷ 2 | 1013 | 0 |
| 1013 ÷ 2 | 506 | 1 |
| 506 ÷ 2 | 253 | 0 |
| 253 ÷ 2 | 126 | 1 |
| 126 ÷ 2 | 63 | 0 |
| 63 ÷ 2 | 31 | 1 |
| 31 ÷ 2 | 15 | 1 |
| 15 ÷ 2 | 7 | 1 |
| 7 ÷ 2 | 3 | 1 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
| Read the remainders from the bottom up: 11111101010 | ||
How it works
- A base (or radix) says how many digits a number system uses: binary uses 0 and 1, octal 0 to 7, decimal 0 to 9, and hexadecimal 0 to 9 plus A to F (10 to 15).
- To read a number in any base, multiply each digit by the base raised to its position (counting from 0 on the right) and add the results.
- To write a decimal number in another base, divide by the base repeatedly and read the remainders from the last to the first.
- Prefixes 0b (binary), 0o (octal) and 0x (hex) are accepted, and spaces or underscores between digits are ignored. Very long numbers stay exact.
hex to decimalConvert hex to decimal with the working shown: each hex digit times a power of 16. Includes a hex to decimal table from 0 to FFFF and a web color example.
binary to decimalConvert binary to decimal with the working shown: each 1 bit adds a power of 2. Includes a binary to decimal table for 4-bit and 8-bit values and byte examples.
decimal to binaryConvert decimal to binary with the repeated-division working shown: divide by 2 and read the remainders upward. Includes a 0 to 1,024 decimal to binary table.
decimal to hexConvert decimal to hexadecimal with the working shown: divide by 16 and read the remainders upward. Includes a decimal to hex table from 0 to 65,535.
Frequently asked questions
Why do programmers use hexadecimal?
One hex digit stands for exactly four binary digits, so a byte (8 bits) is always two hex digits. 1111 1111 in binary is FF in hex and 255 in decimal.
Can I convert negative numbers?
Yes, with a minus sign. The tool shows the signed value, not a two's complement bit pattern.
Calculations run in your browser. Nothing you enter is sent anywhere or added to a searchable page address. How we calculate