Binary To Decimal
Convert a binary (base-2) number into decimal (base-10).
Share on Social Media:
Paste a binary number (made only of 0s and 1s) and this tool converts it to its decimal (base-10) value. You can convert several numbers at once by separating them with spaces or new lines, or upload a .txt file. The conversion uses exact arbitrary-precision arithmetic, so even very long binary strings convert with every digit correct.
How binary to decimal works
Binary is a base-2 number system. Each position is worth twice the one to its right: from the right, the place values are 1, 2, 4, 8, 16, 32, 64, 128, and so on. To convert, add up the place values wherever there's a 1.
Example: 101101
| Bit | 1 | 0 | 1 | 1 | 0 | 1 |
|---|---|---|---|---|---|---|
| Place value | 32 | 16 | 8 | 4 | 2 | 1 |
| Counts? | 32 | – | 8 | 4 | – | 1 |
32 + 8 + 4 + 1 = 45.
A faster method for doing it in your head is doubling: start at 0, and for each bit from left to right, double your running total and add the bit. For 101101: 0→1→2→5→11→22→45. This is exactly how the tool calculates, and it works for numbers of any length.
Values worth memorising
1111= 15 (one hex digit's worth, a "nibble")11111111= 255 (the largest value in one byte, the reason colour channels and IPv4 octets top out at 255)10000000= 128;1 followed by n zeros= 2n- 32 ones = 4,294,967,295 (the largest unsigned 32-bit integer)
Where you'll use it
- Networking: subnet masks and IP addresses are 32-bit binary numbers written in decimal octets.
11111111.11111111.11111111.00000000is 255.255.255.0, a /24. - Programming: bit flags, permissions (Unix file modes are binary groups written in octal), and reading low-level data.
- Study: checking homework and exam practice in computer science and digital electronics.
Things to watch for
This tool treats input as an unsigned whole number. In computing, the same bits can mean something else: in 8-bit two's-complement, 11111111 means −1, not 255. If you're working with signed values, convert here and then apply the two's-complement rule (if the top bit is 1, subtract 2n). Spaces split numbers, so 1010 1010 converts as two numbers (10 and 10). Remove the space to convert it as a single byte (170).