Convert an IPv4 address to and from its 32-bit decimal integer representation.
An IPv4 address is a 32-bit number typically displayed in dotted-decimal notation. Converting to a single integer treats the four octets as a big-endian 32-bit value: first_octet * 2^24 + second_octet * 2^16 + third_octet * 2^8 + fourth_octet.
IP to decimal
decimal = octet1 * 2^24 + octet2 * 2^16 + octet3 * 2^8 + octet4
Some databases store IPs as integers for efficient range queries and indexing. Firewall rules, ACLs, and programmatic comparisons are also often faster with integer representations than string parsing.
Yes — most browsers and operating systems accept decimal IP notation (e.g. http://3232235777 for 192.168.1.1) because the underlying socket API converts it back to the standard 32-bit representation before connecting.