How to Convert Binary to Decimal

Each of the bits in a binary number has an equivalent decimal value. In the case of an 8-bit binary number (also known as a byte or octet) the values are:

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

x | x | x | x | x | x | x | x |

In order to convert the binary number to decimal, wherever a binary 1 exists we are going to add the decimal equivalent of this bit to the decimal equivalent of all other bits that are also a 1. For example, take the binary number 10110110.

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 |

The left-most bit is a 1 so we add the decimal equivalent of that bit to our answer = 128.

The next bit (decimal equivalent 64) is a 0 and therefore we add nothing.

The next bit is a 1 (decimal equivalent 32), so we add 32 to the answer: 128 + 32 = 160.

We continue dong this until the end of the binary number is reached. The resulting sum is:

128 | + | 0 | + | 32 | + | 16 | + | 0 | + | 4 | + | 2 | + | 0 | = | 182 |

1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 |