Convert an IP address to binary
First published on August 9, 2006
When I was learning the basics about computer networks, the Internet, etc., the concept of binary numbers was an essential building block in understanding concepts such as subnet masks and other nerdy stuff (admittedly, I don’t actually remember how subnet masks work, but that’s beside the point). IP addresses look something like this: 192.168.0.1 but are actually represented by a number such as this: 11000000.10101000.00000000.00000001.
How the heck do they come up with that? Well, each binary string in an IP address has 8 numbers, which we will call “slots”. Slots are read from right to left. A “1” means that the slot is “open” or “on” and a “0” means that the slot is “closed” or “off”. 11111111 means that every slot is open. From right to left, the first slot’s value is 1, and each successive slot’s value is double the previous one (128, 64, 32, 16, 8, 4, 2, 1). To calculate the value of binary string, add up each open slot’s value.
00001100 represents the number 12. Why? The third slot (from the right) is open (because it has a 1) and has a value of 4. The fourth slot is open and has a value of 8. By adding up the value of all open slots, you arrive at 12.
Using only 0’s and 1’s, a set of 8 slots can represent every number between 0 and 255. Each number in an IP address can only be between 0 and 255.
Here’s a calculator to check whether you know how to convert normal IP addresses to binary numbers.
January 18th, 2007 at 2:11 pm
Chris says:
Thank you so so much for posting this! I am doing a networks module at university and have an exam and never understood how to do it. This is so clear! ou’ve saved my life!!
February 17th, 2007 at 11:18 am
Frank says:
Nice one mate, that’s a great help.
March 8th, 2007 at 2:19 am
russ says:
LEGEND thanks in class went way over my head but makes sense here
May 11th, 2007 at 6:12 am
Dan says:
This has been a massive help. Why dont they teach you this as simple as this in college. Thanks again
September 27th, 2007 at 6:45 am
Mutaz says:
Thank you .. you made it easy
November 6th, 2007 at 8:58 am
kEvone says:
Thanks a lot for the information. I would have been nice to understand the (128, 64, 32, 16, 8, 4, 2, 1) places for IP addresses in my lecture. I didn’t realize that only converting the decimal numbers to binary wouldn’t cut it. Very nice!
January 8th, 2009 at 3:27 am
.mod. says:
Woo hoo ip is busted thank you :).
February 20th, 2009 at 11:21 am
Wiremonkey says:
Good review. I remember my cisco networking teacher trying to explain all this to us and it was way over my head at the time. The way you explained it broke it down pretty well. Cheers!
March 3rd, 2009 at 10:14 am
Stanley Ratnadoss says:
Thank you so much for your useful and really simple clear cut way of explaining..Even a fool like me could understand it.Thanks buddy..Keep up ur good work..It really helped me to regain what i had forgotten ..Thanks again
March 9th, 2009 at 12:25 am
Nigel says:
This was the best help ever thank you for allowing access to this great idea. It really helped cause i totally forgot how to convert to binary. Thanks again
June 9th, 2009 at 3:51 am
Darko says:
Fala MNOGU NAJDOBAR SI!!!
You are the best!
June 11th, 2009 at 7:24 am
Bill says:
Thanks for the help I am going through the 270 and this helped me put it just over the top .When I get to my mcse/mcsa course I will be back searching for more .
Thanks Bill
July 10th, 2009 at 2:08 am
Shaun says:
OK something very strange… I found this via a type… and now It got my brain wondering… Ping 10.0.0.09 and it replies with 10.0.0.9 but if you try with 10.0.0.011 then it replies with 10.0.0.8… So Still looking and nothing can explain this to me now… Please if someone can help let me know…
Thanks
November 22nd, 2009 at 2:27 am
Habib Ullah Bahar says:
@Shaun: Its becoz when you typed 10.0.0.011, ping program accept the Right most portion as Octate, ie in base-8 format.
In base-8 format, 011 is equivalent to Decimal 8, so 10.0.011 becomes 10.0.0.8 in decimal.
November 26th, 2009 at 11:56 pm
Abhishek says:
Can we open websites using this binary Ip Address?
for ex :
can we open google.com (IP : 64.233.169.106) using its binary 01000000.11101001.10101001.01101010
I tried but its not working. I tried by typing http://01000000.11101001.10101001.01101010/ in the browsers address bar
April 25th, 2010 at 6:54 am
.dll says:
I do not think that that would work because the network routers are configured to handle TCP/IP packets and they use IPv4 addresses as the source and destination.
June 19th, 2010 at 11:54 pm
Aether says:
http://0x4A7D2769/
that’s google, in hex
September 28th, 2010 at 9:31 am
Dan says:
Awesome explanation. I just got done reading about how to do conversions in my class book and was a bit confused by it. Did a google search for a calculator, ended up here and now am able to do them without the calculator.
November 8th, 2010 at 8:01 pm
Margaret says:
Great explanation. I was doing this in a class and the book did not clearly explain it. Reading your blog I understood within a few minutes. thanks
November 12th, 2010 at 6:46 pm
tjuno says:
Thanx alot..i hav an exam in a few hours,this cleared i whole lot..
January 5th, 2011 at 5:21 am
Sumit says:
Thanks ! can you provide the logic to check the valid IP in Binary Format.
January 27th, 2011 at 2:25 am
nik says:
you can convert ip addys to binary with the scientific calculator on windows. You can even convert to hex and octal but i dont know why you would need to.
May 24th, 2011 at 8:11 am
jon-edc says:
damn I’m in a new horizons network + course got books and everything and they couldn’t come close to simplifying this. Thanks a MIl!
July 4th, 2011 at 2:13 pm
Ryan says:
I found this very useful. I found most books complicate it. Helped me figure it out.
July 31st, 2011 at 7:46 pm
Moose says:
i guess hex can be useful, if youre really bored you can ping crap in hex… and if youre REALLY bored you could convert it all to hex yourself. i see all the different numbering systems as just multiplying each character by the power of the base that it requires. so with base 2 its simply powers of 2 (128,64,32,16,8,4,2,1) where hexadecimal is powers of 16 (16^4,16^3,16^2,16^1,16^0) as well as octal (probably a more worthless number system) (8^4,8^3,8^2,8^1,8^0). its all just a matter of taking what you know about how the decimal system works (10^4,10^3,10^2,10^1,10^0) and applying the same rule to a new system, in this way you can pick up any new numbering system you need, as well as make up your own for practice.
September 1st, 2011 at 11:18 am
Chris says:
I’m bored sitting in the library and remember i didn’t do good on this portion on the test. To understand it I looked it up and totally understand it now, took only a couple minutes. Great help, thanks a bunch!
November 30th, 2011 at 3:28 am
Rod says:
Well done this is the best explanation I ever had on the matter I do intend to prepare for the CCNA and the understanding of the conversion of an ip address into binary was a daunting task. Now it is crystal clear once again thank you very much.
February 24th, 2012 at 11:27 pm
Mystie says:
wow! wow! wow! thanks alot!!!! i have been strugling with this! you make it so simple. What’s wrong with theses teachers! why can’t they use the "kiss" system. thanks