IP Address to a IP Number

Apr 18, 2009


How TO convert an IP Address to a IP Number?
IP address (IPV4) is divided into 4 sub-blocks. Each sub-block has a different weight number.

To calculate IP Number the formula is given below
IP Number = 16777216*a + 65536*b + 256*c + d

where
IP Address = a.b.c.d


For example, if IP address is “127.4.5.13“, then its IP Number would be

IP Number = 16777216*127 + 65536*4 + 256*5 + 13
= 2130706432 + 262144 + 1280 + 13
= 2130969869

0 comments:

Post a Comment

About Author

My photo
Working as an Automation Analyst, Ritesh is very passionate about developing tools and apps. His profile contains a long list of tools developed for Windows and apps for Android platform.