Converting an IP Address To Binary Code

C. Oscar Lawshea
BitWise Tech Tips
Published in
3 min readJun 15, 2021

--

Binary is the language of computers; It is nothing more than a series of 1’s and 0’s. To us, it means nothing but to our computer systems it holds vital information used to carry out functions. An IP address is used to identify devices on a network (servers, fax machines, printers, etc.). IP addresses are usually expressed in this format 192.168.0.0; This configuration makes sense to the human user but it means nothing to our computer. As stated before, computers are binary systems so it will need to convert the IP address to a binary format in order to undertsnad it. In this lesson, you will learn how to convert IP addresses to binary code, which is a basic skill used in subnetting operations.

We will convert the address 198.168.1.0.

  1. First, you will separate the IP into four sets of numbers:

2. You will use this table to convert each set of numbers:

Memorize this table, these numbers will aid you in the conversion.

3. Starting with 198:

To explain it simply, you will ask yourself what numbers in the top most row can I use to sum up 198? Starting from left to right, its obvious you can use 128, 64, 4, and 2 to total 198; So you will place a 1 underneath each of those numbers in the table as depicted in the image above. The left over, unused numbers will all have a 0 placed underneath them.

That’s the first part of the IP address converted, now you will convert the rest using the same method. Once complete, your table should end up looking like this:

Simple yes? Now you will put the the numbers back in order as in the figure below:

11000110 = 198 .1010100 = 168 . 00000001 = 1 . 00000000 = 0; Congratulations you now know how to convert IP addresses to binary code. This method can also work for subnet mask addresses as well. We will continue our study of binary in next week’s tutorial. Thanks for reading!

If you liked this post please take a look at my other posts here.

--

--

C. Oscar Lawshea
BitWise Tech Tips

I enjoy science and learning new tech skills. When I'm not blogging or tinkering with computers, I'm video/pc gaming, watching movies or being a gym bro.