Decimal-to-binary conversion works by progressively subtracting the largest possible powers of two from a given value and recording a 1 or 0 for each bit position. Mastering this process alongside binary-to-decimal conversion is essential for networking and IT fundamentals.
Decimal to Binary Conversion
We're going to learn to go the opposite way now, going from decimal to binary. It's not quite as easy of a process, but it's not that difficult either, which is a good thing, because you are going to need this throughout the rest of the course as well. Make sure you get this down, make sure you understand it, make sure that you get good at it, because you will be using this from here on out.
I have my chart here; this is what we're going to use. I recommend, at least at the beginning, using the chart to do this conversion.
I'm going to come up with some sort of decimal number, so I'm going to use the number 191, and we're going to convert that into binary. What we do to convert it into binary is we just start at the leftmost column and we say, is there a 128 in this number? Another way of saying this is, is 191 larger than 128? The answer to that is yes, so there exists a 128 in this number. So I'm going to do that, and then I'm going to subtract 128 from here.
I'm going to have to pull out that subtraction here, and I'm going to have to borrow — it's been a while since I've done this — so we have a 3 here and a 6 and 0. So 63, we're left with 63.
Then the next answer: is there a 64 in there? The answer to that is no, so I'm going to put a 0. Is there a 32 there? The answer to that is yes, so I'll put a 1 there. I'm going to subtract 32 from this and I will get 31 as the answer. Is there a 16 inside that 31? I'm going to say yes, there is, so I'll subtract the 16 from there. I'm going to have to do the borrowing once again, so I do that and I end up with 15. Is there an 8 inside there? Yes, there is, so I'm going to subtract 8 from 15, and then I can say that's going to be 7. Is there a 4 in there? Yes, there is, so I'm going to subtract the 4 out of that, and I end up with a 3. Is there a 2 in there? Yes, there is, so I'll subtract the 2 from that and I end up with 1, and so there's a 1 in there. So there is the binary equivalent of this number.
So there you have it. It's pretty easy, actually, to do this. It just takes a little more work than the addition that we did when we were converting it the other way.
Here's the same exercise that we've been doing. What you're going to do is translate from these decimal numbers here on the left-hand side and convert them into a binary number on the right-hand side. Go through that, and then you can see what the answer is.
Here's the answer, with all of the bits that are turned on. Check it over and make sure you got everything accurate.
Hopefully you got everything accurate. So now what you're going to do is hopefully practice this a couple more times, and make sure that you have this down, both converting from decimal to binary and from binary to decimal, because it's going to be pretty important. Next, I'm going to show you how to actually check your work, so you can start creating all of this stuff on your own just for practice and then check your work on it.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →