Search code examples
javaphpnetwork-programmingdecimalip-address

IP address conversion to decimal and vice versa


Suppose my decimal number is 9766322441 so its corresponding is 70.30.65.9 but when this IP address IC converted back, its gives some different decimal number 1176387849... and when I convert the IP address pf google.com i.e 64.233.187.99 then it gives the 1089059683 and reverse conversion gives the correct IP address i.e 64.233.187.99 ...

My question is what is wrong with the the above mention number? I also try with 9579342332 but the same result. It gives the wrong reverse conversion??

What is the reason behind it??

You could use this calculator for calculations.


Solution

  • IPv4 addresses are on 32 bit.

    The number 9,766,322,441 cannot be represented on 32 bit (max: 4,294,967,295).