Convert binary to decimal
To convert a binary value into decimal, find each bit that has the value 1.
Each bit position holds a power of two.
Add the powers of two of all the bits that have the value 1.
Try binary to decimal conversion in the bit editor
The bits 100101100, which give 300. Edit the expression or select a bit to flip it.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
300
value · 16 bits · unsigned
- binary
- 0b0000000100101100
Binary to decimal conversion step by step
Convert 100101100 into a decimal value: The steps follow the value above.
- Bit 8 has the value 1. Add 2^8, which is 256.
- Bit 5 has the value 1. Add 2^5, which is 32.
- Bit 3 has the value 1. Add 2^3, which is 8.
- Bit 2 has the value 1. Add 2^2, which is 4.
- The total is 300.
The value of each bit position
| Bit | Power of two | Value |
|---|---|---|
| 0 | 2^0 | 1 |
| 1 | 2^1 | 2 |
| 2 | 2^2 | 4 |
| 3 | 2^3 | 8 |
| 4 | 2^4 | 16 |
| 5 | 2^5 | 32 |
| 6 | 2^6 | 64 |
| 7 | 2^7 | 128 |
| 8 | 2^8 | 256 |
| 9 | 2^9 | 512 |
| 10 | 2^10 | 1024 |
| 11 | 2^11 | 2048 |
| 12 | 2^12 | 4096 |
| 13 | 2^13 | 8192 |
| 14 | 2^14 | 16384 |
| 15 | 2^15 | 32768 |
Where binary to decimal conversion is used
A logic analyser and a serial monitor often show a raw binary value.
A decimal form is easier to compare against a specification limit.
Binary to decimal conversion: points to note
- Bit numbers start at 0, not 1.
- The result depends on the signed mode. The bits 11111010 give 250 unsigned and -6 signed.
- Zeros at the left do not change the result.
The full bit editor
The full editor holds many values, evaluates expressions across them, and reads live values from a serial port.
Open this value in the full editorQuestions about binary to decimal conversion
- What is 100101100 in decimal?
- The value is 300. The set bits are 8, 5, 3 and 2, which give 256 + 32 + 8 + 4.
- Does the bit width change the result?
- Not for an unsigned value. For a signed value the bit width sets which bit is the top bit.
- What is 11111111 in decimal?
- As an unsigned 8-bit value it is 255. As a signed 8-bit value it is -1.