Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Convert a binary number to decimal, octal, and hexadecimal.
42
Binary (base 2) is how computers internally represent all data, but it's hard for people to read at a glance -- this converter translates a binary string of 0s and 1s back into a familiar decimal number, and shows the equivalent octal and hexadecimal representations at the same time.
Enter a binary number using only the digits 0 and 1. The result shows the equivalent decimal, octal, and hexadecimal values simultaneously.
Decimal Value = Sum of (each binary digit × 2its position from the right, starting at 0)
Each binary digit represents a power of 2 based on its position -- the rightmost digit is 20 (1), the next is 21 (2), then 22 (4), and so on. Adding up the powers of 2 where the binary digit is 1 gives the decimal value.
| Binary | Decimal | Hex |
|---|---|---|
| 1 | 1 | 1 |
| 1000 | 8 | 8 |
| 10000 | 16 | 10 |
| 11111111 | 255 | FF |
| 100000000 | 256 | 100 |
Reading a binary value from a debugger, register dump, or networking tool and understanding it as a familiar decimal number. Students and self-taught programmers learning how positional number systems work.
This tool treats binary input as an unsigned (always non-negative) value. If your binary string represents a negative number in two's complement form, use the Two's Complement Calculator to interpret it correctly instead of reading it as a plain unsigned value.
Instead of writing out every power of two, you can double as you go. Start from the left with 0. For each digit, double the running total and add the digit. Take 101101: 0 × 2 + 1 = 1; 1 × 2 + 0 = 2; 2 × 2 + 1 = 5; 5 × 2 + 1 = 11; 11 × 2 + 0 = 22; 22 × 2 + 1 = 45. The answer is 45, which matches 32 + 8 + 4 + 1. Both methods agree; use whichever you find easier.
More examples: 11001000 is 128 + 64 + 8 = 200 (hex C8). 11110000 is 240 (hex F0). 1000000000 is 2 to the 9th power, or 512.
The tool accepts only the characters 0 and 1. Anything else, such as a 2, a letter, a space, or a leading 0b prefix, is treated as invalid. If you copy a value from a debugger that prints spaces between groups, like 1100 1000, remove the spaces before pasting. Leading zeros are fine and do not change the value: 00001010 gives the same result as 1010.
The most common mistake is counting positions from the left instead of the right. The rightmost digit is the 1s place. Another error is reading a signed value as unsigned. For example, 11111111 is 255 as unsigned, but in an 8-bit two's complement context it represents -1. The converter here always returns the unsigned reading, so use the Two's Complement Calculator if the data is signed.
A third mistake is entering a bit string that represents something other than an integer, such as a floating-point number or a character code with a defined encoding. The tool will still return the integer value of those bits, but that number may not be the meaning the original data intended.
The tool uses JavaScript numbers, which are exact for whole numbers up to 9,007,199,254,740,991 (53 binary ones). Longer strings can produce rounded results, so use a big-integer tool for 64-bit values and beyond.
Assign each digit (from right to left) a value of 2 raised to its position (starting at 0), then add up the values where the digit is 1 -- for example, 1010 is (1×8)+(0×4)+(1×2)+(0×1) = 10.
No -- this converts unsigned binary only. For negative numbers represented via two's complement, use the Two's Complement Calculator.
45. That is 32 + 8 + 4 + 1.
No. Remove spaces first, since only the digits 0 and 1 are accepted.
This tool reads unsigned values, so all ones in 8 bits is 255. In signed two's complement it would mean -1.
No. 0001 and 1 both equal 1.
Reference: NIST Weights and Measures