IPv4 / IPv6 Converter

Convert, validate, and transform IP addresses — decimal, binary, IPv4-mapped IPv6, expand/compress.

Enter an IP address above.

How to Use the IP Converter

  1. IPv4 ↔ IPv6 — enter an IPv4 address to see its IPv4-mapped IPv6 form, or an IPv6 mapped address to extract the IPv4. Also shows expanded and compressed IPv6 forms.
  2. Decimal — enter an IPv4 address to get its 32-bit decimal integer, or enter a decimal integer to get the dotted-decimal IPv4.
  3. Binary — enter an IPv4 address to see its 32-bit binary representation, colour-coded by octet.
  4. Validate — enter any IP address to check if it is valid IPv4 or IPv6, and see its classification (public, private, loopback, link-local).

IPv4 vs IPv6

IPv4 (Internet Protocol version 4) uses 32-bit addresses, allowing approximately 4.3 billion unique addresses. Written as four decimal octets separated by dots — for example, 192.168.1.1 — IPv4 was designed in the 1970s when the internet was a small research network. By the 2010s, available IPv4 addresses were exhausted, which accelerated adoption of IPv6.

IPv6 uses 128-bit addresses, written as eight groups of four hexadecimal digits separated by colons: 2001:0db8:85a3:0000:0000:8a2e:0370:7334. This provides approximately 3.4 × 10^38 unique addresses — enough for every atom on Earth to have a unique IP. IPv6 also includes improvements over IPv4: mandatory IPsec support, simpler header format, built-in multicast, and no need for NAT.

IPv4-Mapped IPv6 Addresses

IPv4-mapped IPv6 addresses allow IPv6 sockets to communicate with IPv4 hosts. They take the form ::ffff:a.b.c.d or in pure hex ::ffff:aabb:ccdd. When an IPv6 server receives a connection from an IPv4 client, the OS represents the source address in this mapped form. The first 80 bits are zero, the next 16 bits are all ones (FFFF), and the final 32 bits hold the IPv4 address. This is different from IPv4-compatible addresses (::a.b.c.d), which are deprecated.

Private IP Ranges (RFC 1918)

Three IPv4 ranges are reserved for private use and are not routed on the public internet:

  • 10.0.0.0 – 10.255.255.255 (10.0.0.0/8) — Class A, used in large enterprise networks
  • 172.16.0.0 – 172.31.255.255 (172.16.0.0/12) — Class B, used in medium networks
  • 192.168.0.0 – 192.168.255.255 (192.168.0.0/16) — Class C, used in home/small office networks

The loopback range 127.0.0.0/8 refers to the local machine itself. 127.0.0.1 (localhost) is the most commonly used loopback address. Link-local addresses 169.254.0.0/16 are assigned automatically when DHCP fails (APIPA on Windows).

IPv6 Address Compression

IPv6 addresses can be abbreviated by two rules defined in RFC 5952. First, leading zeros in any group may be omitted: 0db8 becomes db8. Second, one or more consecutive groups of all zeros may be replaced by a double colon ::, but only once per address. So 2001:0db8:0000:0000:0000:0000:0000:0001 compresses to 2001:db8::1. When expanding, the :: is replaced by as many zero groups as needed to bring the total to eight groups.

IP Addresses in Databases

Storing IP addresses as decimal integers rather than strings allows fast range queries: instead of string comparisons, you compare integers. For example, to find all IPs in the 192.168.1.0/24 subnet, you check decimal >= 3232235776 AND decimal <= 3232236031. MaxMind GeoIP databases use this approach. In PostgreSQL, the inet and cidr types provide native IP storage with built-in operator support. See our URL Parser for related network tooling.

Frequently Asked Questions

An IPv4-mapped IPv6 address represents an IPv4 address within the IPv6 address space. It has the form ::ffff:x.x.x.x. For example, 192.168.1.1 maps to ::ffff:192.168.1.1. This is used in dual-stack networking so IPv6 sockets can communicate with IPv4 hosts.
IPv4 uses 32-bit addresses (4.3 billion possible), written as four decimal octets (e.g. 192.168.1.1). IPv6 uses 128-bit addresses (340 undecillion possible), written as eight groups of four hex digits (e.g. 2001:db8::1). IPv6 was created to address IPv4 exhaustion.
Two rules: leading zeros in each group can be omitted, and one sequence of all-zero groups can be replaced by ::. So 2001:0db8:0000:0000:0000:0000:0000:0001 compresses to 2001:db8::1.
An IPv4 address is a 32-bit integer. The decimal = A×16777216 + B×65536 + C×256 + D. For example, 192.168.1.1 = 3232235777. This is used in database storage and IP range calculations.
Private IPv4 ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Loopback: 127.0.0.0/8. Link-local: 169.254.0.0/16. Any address outside these is public (routable on the internet).