Binary To Decimal
Binary To Decimal
To avoid confusion while using different numeral systems, the base of each individual number may be
specified by writing it as a subscript of the number. For example, the binary number 10011100 may be
specified as "base two" by writing it as 100111002. The decimal number 156 may be written as 15610
and read as "one hundred fifty-six, base ten".
Since the binary system is the internal language of electronic computers, serious computer
programmers should understand how to convert from binary to decimal. Converting in the opposite
direction, from decimal to binary, is often more difficult to learn first.
Note: This is ONLY for counting and does not talk about ASCII translations.
Steps [edit]
1. For this example, let's convert the binary number 10011011 2 to decimal. List the powers of two from
right to left. Start at 20, evaluating it as "1". Increment the exponent by one for each power. Stop
when the amount of elements in the list is equal to the amount of digits in the binary number. The
example number, 10011011, has eight digits, so the list, to eight elements, would look like this: 128,
64, 32, 16, 8, 4, 2, 1
http://www.wikihow.com/Convert-from-Binary-to-Decimal 3/24/2008
How to Convert from Binary to Decimal - wikiHow Page 2 of 4
Here is this step written on paper using the example binary number,
10011011.
3. Draw lines, starting from the right, connecting each consecutive digit of the binary number to the
power of two that is next in the list above it. Begin by drawing a line from the first digit of the binary
number to the first power of two in the list above it. Then, draw a line from the second digit of the
binary number to the second power of two in the list. Continue connecting each digit with its
corresponding power of two.
Here is this step written on paper using the example binary number,
10011011.
4. Move through each digit of the binary number. If the digit is a 1, write its corresponding power of two
below the line, under the digit. If the digit is a 0, write a 0 below the line, under the digit.
Here is this step written on paper using the example binary number,
10011011.
5. Add the numbers written below the line. The sum should be 155. This is the decimal equivalent of
http://www.wikihow.com/Convert-from-Binary-to-Decimal 3/24/2008
How to Convert from Binary to Decimal - wikiHow Page 3 of 4
the binary number 10011011. Or, written with base subscripts: 100110112 = 15510
Here is this step written on paper using the example binary number,
10011011. The sum of the bottom row, 155, is its decimal equivalent. Or,
written with base subscripts: 100110112 = 155 10
6. Repetition of this method will result in memorization of the powers of two, which will allow you to skip
step 1.
Tips [edit]
Practice. Try converting the binary numbers 110100012, 110012, and 111100012. Respectively, their
decimal equivalents are 20910, 25 10, and 24110.
The calculator that comes installed with Microsoft Windows can do this conversion for you, but as a
programmer, you're better off with a good understanding of how the conversion works. The
calculator's conversion options can be made visible by opening its "View" menu and selecting
"Scientific".
There is another way to convert from binary to decimal, which ignores the binary values of the
columns. Take the left-most one digit and start there as "1." For each column to the right, double
your subtotal and add the next digit. For example, "1011" would entail the following: "1," (double) 2,
(add 0) 2, (double) 4, (add 1) 5, (double) 10, and finally (add 1) 11. This technique is very useful for
converting large numbers in your head, as you only need to keep track of your sub-total (you are
simply adding and doubling).
Warnings [edit]
This uses unsigned binary, rather than signed, floating point or fixed point.
http://www.wikihow.com/Convert-from-Binary-to-Decimal 3/24/2008
How to Convert from Binary to Decimal - wikiHow Page 4 of 4
Categories:Programming
Authors
Sean Hickey, Anonymous, Tom Viren, Sondra C, Rabinux, Jonathan Thorne, Marshall "Disgrace",
Twerty, 1guitarhero2, Teikwanda, Travis Derouin, Maniac, Versageek
Thanks to all authors for creating a page that has been read 28,191 times.
All text here is freely available to copy, adapt, and distribute under the terms of the Creative Commons
Attribution-NonCommercial-ShareAlike 2.5 License.
All text shared under a Creative Commons License. Powered by Mediawiki. wikiHow is a carbon neutral website
http://www.wikihow.com/Convert-from-Binary-to-Decimal 3/24/2008