Converts an IPv4 address to a single decimal number and back. This is what you need when addresses are stored as integers or compared as ranges. Hexadecimal and binary forms are also shown.
This tool converts an IPv4 address into a single decimal number, and converts such a number back into an address. It is what you need when addresses are stored as integers or compared as ranges.
Here to are the four octets and the decimal value. The coefficients are , , and , so the leading octet carries the most weight.
An address is a 32-bit number to begin with, split into four groups of eight bits and joined by dots for legibility. Removing the dots simply returns it to an integer.
As an integer, comparisons and range tests are written with nothing more than inequalities. Left as text, 10.0.0.9 and 10.0.0.10 will not sort into the right order.
The address 192.168.1.1 is 3232235777 in decimal and C0A80101 in hexadecimal.
192 × 16777216 = 3221225472, 168 × 65536 = 11010048 and 1 × 256 = 256; adding the final 1 gives 3232235777. In hexadecimal each octet occupies exactly two digits.
Only IPv4 is handled here. An IPv6 address is 128 bits and will not fit this form.
When converting from a decimal value, it must lie between 0 and 4294967295.