The Easy Way to Convert Decimal Numbers to Binary Numbers and Back Again

Home > Blogs > CompTIA > The Easy Way to Convert Decimal Numbers to Binary Numbers and Back Again

The Easy Way to Convert Decimal Numbers to Binary Numbers and Back Again

Like This Blog 0 Mark Jacob
Added by May 8, 2020

Converting from one number base to another.  Riveting stuff!  But if you want to have confidence in your skills as A+, Network+, or CCNA certified, you don’t want to overlook this seemingly small area of study.  It is quite important because humans like to look at decimal (base 10) numbers, whereas computers work with binary (base 2) numbers.  Let’s dive right in.

Although it could be argued that the ability to make monetary change is a dying art, I use making change as a method to convert from decimal to binary.  First we start with a chart of 8 bit positions with the base number (in this case, 2) below them.  This is shown in figure 1:


The next step, which is true for number systems in general,  not just binary, is to start putting exponent values for each “2”, starting with zero at the far right, as shown in figure 2.


Below that, we put the actual value of two to that exponent, shown in figure 3.


You have probably seen this many times, perhaps even in your dreams after a studying rampage.  My trick is to imagine that the numbers underneath represent the values of imaginary coins, and I am using them to make change.  The coins might look like figure 4:


So if I owe someone, say, 185¢, how would I do it?  (What is really happening here is I am converting 185 decimal to its equivalent in binary, but ssshhhh.)  Using the coins provided, the closest I can get to 185 is 128, so I will give a ‘128’ coin.  I indicate that by putting a 1 above 128 on the line and subtracting 128 from what I owe, just like I would with real money.  That is shown in figure 5:





So I still owe 57¢.  I look at my coins and realize a ‘64’ coin would be too much, and since I don’t give it, I put a 0 above it.  But a ‘32’ coin is the largest value coin that does not exceed what I owe.  So I put a 1 there.  Those two selections and subtracting what I have paid are shown in figure 6:


– 32


So I am down to owing 25¢.  Look at my remaining coins and I find ‘16’ to be the largest value coin that does not exceed what I owe.  Let’s grab one in and subtract it from our total figure 7:


– 16



I still owe 9.  That means grabbing the ‘8’ coin would get me closer while not exceeding the amount owed.  So I put a 1 there and subtract it from what I owe.    This is shown in figure 8:


– 8



I still owe 1, and I have coin ‘worth’ 1, so I put a 0 above the’4’ coin and also above the  ‘2’ coin (since I will not use them) and put a 1 above the ‘1’ coin and subtract.  All this is shown in figure 9:


– 1



The numbers on top from left to right represent in binary the value 185 in decimal.  That is written like this:  1 0 1 1 1 0 0 1.

If you want to go in the other direction, I liken it to someone handing you a bunch of coins and asking you to tally the value.  So let’s do that using figure 9 above.  Where the 1s are I add those coins.  So I have a 128 coin, a 32 coin, a 16 coin, an 8 coin, and a 1 coin.  Add those up:





+ 1



Hey, it matches!  If you ever want to check your math, you can use Windows Calculator as it shows binary, octal, decimal, and hexadecimal numbers.  Make sure you select Programmer mode.  Let’s see the above example in Windows Calculator, in figure 10:




If you enjoy the mental calisthenics of making change, this method of decimal-binary / binary-decimal conversion should warm the cockles of your heart!

Until next time….

Mark Jacob
Cisco and CompTIA Network + Instructor – Interface Technical Training
Phoenix, AZ

Video Certification Training: CompTIA Network +

Videos You May Like

A Simple Introduction to Cisco CML2

0 3698 0

Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2

Configuring Windows Mobility Center and How to Turn it On and Off

1 1411 1

Video transcription Steve Fullmer: In our Windows training courses, we often share information about the Windows 8.1 Mobility Center. Mobility Center was introduced for mobile and laptop devices in Windows 7. It’s present and somewhat enhanced in Windows 8. Since we don’t have mobile devices in our classrooms, I decided to take a little bit … Continue reading Configuring Windows Mobility Center and How to Turn it On and Off

OSPF Adjacency Troubleshooting Solution – Getting Close to the OSPF adj

0 247 1

In this video, Cisco CCNA & CCNP instructor Mark Jacob shows how to troubleshoot OSPF Adjacency issues by showing the distance between routers with the show ip ospf neighbor command.

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.