A Guide to Binary Numbers

How to convert Binary to Decimal

1286432168421Total Value
11111111255
000000000
10011110158
Above you can see the number 10011110.  To find the decimal equivalent, simply add the value of each place containing a “1”.

128+0+0+16+8+4+2+0=158

How to convert Decimal to Binary

1286432168421

Let’s take the number 245 and convert it to Binary.  Here are the steps.

  1. Start from the left on the chart above and ask “Will 128 fit into 245?” The answer is yes, so we subtract 128 from 245 and place a 1 in the first slot.
1

245-128=117.  117 is our new number.

  1. Move to the next slot and ask the same question using the new number. “Will 64 fit into 117?”  The answer is yes again, so we subtract 64 from 117 and place a 1 in the second slot.
11

117-64=53.  53 is our new number.

  1. Move to the next slot and ask the same question using the new number. “Will 32 fit into 53?”  The answer is yes again, so we subtract 32 from 53 and place a 1 in the third slot.
111

53-32=21.  21 is our new number.

  1. Move to the next slot and ask the same question using the new number. “Will 16 fit into 21?”  The answer is yes again, so we subtract 16 from 21 and place a 1 in the fourth slot.
1111

21-16=5.  5 is our new number.

  1. Move to the next slot and ask the same question using the new number. “Will eight fit into 5?”  This time the answer is no.  Because the answer is no, we put a 0 in the fifth slot and move on.
11110
  1. Move to the next slot and ask the same question. “Will four fit into 5?”  The answer is yes, so we subtract four from 5 and place a 1 in the sixth slot.
111101

5-4=1.  1 is our new number.

  1. Move to the next slot and ask the same question using the new number. “Will two fit into 1?”  The answer is no.  Because the answer is no, we put a 0 in the seventh slot and move on.
1111010
  1. We ask the same question. “Will one fit into 1?”  The answer is yes, so we put a 1 in the last slot, and we are done.
11110101

We are finished.  You have successfully converted the decimal number 245 to the Binary number 11110101.



About The Author


Eric Vanderburg

Eric Vanderburg is an author, thought leader, and consultant. He serves as the Vice President of Cybersecurity at TCDI and Vice Chairman of the board at TechMin. He is best known for his insight on cybersecurity, privacy, data protection, and storage. Eric is a continual learner who has earned over 40 technology and security certifications. He has a strong desire to share technology insights with the community. Eric is the author of several books and he frequently writes articles for magazines, journals, and other publications.

Leave a Reply