Why convert IP addresses?
Computers store an IPv4 address as a single 32-bit number; the familiar dotted form like 192.168.0.1 is just a human-friendly way to write its four bytes. Different tools and databases use different representations:
- Integer (decimal): compact storage and fast range queries in databases and geolocation files.
192.168.0.1is3232235521. - Hexadecimal: used in packet captures, kernel tables and some log formats:
0xC0A80001. - Binary: essential for understanding subnet masks and CIDR. Every 1 bit in the mask marks the network part.
- IPv4-mapped IPv6: how dual-stack software represents IPv4 clients, for example
::ffff:192.168.0.1.
How the conversion works
Multiply each octet by its place value and add them up: a × 256³ + b × 256² + c × 256 + d. For 8.8.8.8 that is 8 × 16,777,216 + 8 × 65,536 + 8 × 256 + 8 = 134,744,072. To go back, divide by 256 repeatedly and keep the remainders.
IPv6 compression and expansion
IPv6 addresses can be written in shortened form: leading zeros in each group are dropped and one run of all-zero groups is replaced by ::. The converter shows both the compressed form (2001:db8::1) and the full expanded form (2001:0db8:0000:0000:0000:0000:0000:0001). Learn more about IPv6.
http://2130706433/ (which is 127.0.0.1) or octal octets. Attackers use these to bypass naive filters, so always normalise addresses before validating them.Frequently asked questions
Can I enter binary?
Yes. Enter 32 bits for IPv4 or 128 bits for IPv6, with or without dots.
What is the largest IPv4 number?
4294967295, which is 255.255.255.255 (2³² − 1).