TechKnowSurge
CompTIA Tech+ 1.1 CompTIA Tech+ 1.2
VideoComputeFree

DEMO: Decimal to Binary

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.

Complete this video to capture a CTF flag worth 1 point.

About this video

Decimal-to-binary conversion follows a systematic subtraction method built around binary place values, which are the powers of two arranged from largest to smallest, typically starting at 128 for an 8-bit number. For each position, the question is whether the current place value fits within the remaining decimal amount. If it does, a 1 is recorded and that value is subtracted from the remainder; if it does not, a 0 is recorded and the remainder stays unchanged. This process continues across every bit position until the remainder reaches zero and all positions are filled. Working through a concrete example, such as converting 191 to binary, illustrates how the method unfolds in practice. Starting at 128, the value fits, leaving a remainder of 63. The next position, 64, does not fit into 63, so it receives a 0. From there, 32 fits into 63, then 16 into 31, then 8 into 15, then 4 into 7, then 2 into 3, and finally 1 into 1, producing the complete 8-bit binary representation. A place-value reference chart is a reliable aid while the process is still being internalized. Both decimal-to-binary and binary-to-decimal conversion are core competencies in IT and networking, appearing consistently across topics like IP addressing and subnetting. Building fluency with both directions of conversion early ensures a stronger grasp of the technical material that depends on them.

What you'll learn

What's covered

Decimal to Binary Conversion

Aligned to

CompTIA Tech+
1.1 Compare and contrast notational systems.
1.2 Compare and contrast fundamental data types and their characteristics.

Key terms

Binary
The base-2 number system that uses only the digits 0 and 1; the native language of digital computers, which store and process data as electrical on/off states.
Decimal
The base-10 number system using digits 0–9; the standard system used in everyday counting and arithmetic, and the most common format for presenting numeric output to humans.
Place Value
The weight assigned to a digit based on its position within a number; in binary, each position represents a successive power of 2 (1, 2, 4, 8, …), making position the key to decoding binary values.
Positional Subtraction
A method of converting decimal numbers to binary by sequentially subtracting the largest fitting binary place values from the remaining total.

Transcript

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.

Converting 191 to binary

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.

Practice

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.

About TechKnowSurge

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 →