Converting IP addresses from decimal to binary with pen and paper. The old fashioned way.

Posted: September 27, 2012. At: 8:32 AM. This was 5 years ago. Post ID: 4641
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

One important skill in computer networking is converting an IP address to binary from decimal.

Here is an example.

This IP address converts into this binary number.


The way I find is the easiest with pen and paper is to write down this number sequence.

128 – 64 – 32 – 16 – 8 – 4 – 1

Then take the IP address piece by piece and count through each section. You need 128 and 32 to add up part of the IP address in binary, therefore you add a 1 for each section of the number sequence that is needed and a 0 for numbers that you skip from 128 to 1. This really does work. When I was taught this in networking class; this is how I managed to do it on good old fashioned pen and paper. A calculator is handy if you are stuck. Just use a high-school calculator or the bc calculator. Just count from left to right and see which numbers add up to 172 for example and leave out the others. The IP addresses only count up to 255 in each octet. So if you see an IP address in a movie that is higher than 255 it is not correct and therefore not real. The octet is a sequence of eight bits. There are eight bits to a byte; therefore an IP address is four bytes when written in binary.

This IP address:

Equals this number in binary.


And the network mask;

Equals this in binary.


This number;

Equals this in binary.


Once you practice this a few times it becomes clear in your head and you may do this easily. One godsend in modern networking is the advent of DHCP; that allows a DHCP server to give out IP addresses to a client machine when it connects to the network. There is some information on configuring a DHCP server in Linux here: Before DHCP you would have needed to type in an IP address for your machine manually; that would be a nightmare with a thousand machines. Distantly related to computer networking; here is a page that has a screenshot of the first website ever created. Tim Berners-Lee created the World Wide Web and it would not be possible without computer networking and the DHCP servers that give out IP addresses to all of the computers on the Internet. And the DNS servers that map the domain names to IP addresses; e.g the Google website maps to the IP address Otherwise you would need to remember the IP address for every single website. The Chinese Google website maps to the IP address In binary that is: 10101100.11000010.01001000.10100000. The IP address and the domain name are easier to remember than that; but easy to calculate.

A web calculator for IP addresses if you are stuck:

No comments have been made. Use this form to start the conversation :)

Leave a Reply