What is IP Address Validation?
IP address validation checks whether a given string is a properly formatted IPv4 or IPv6 address. This includes verifying that the address follows the correct syntax, uses valid number ranges, and conforms to the standards defined in RFC 791 (IPv4) or RFC 4291 (IPv6).
Beyond simple format checking, our validator also identifies the address type (public, private, loopback, etc.), determines the IP class for IPv4, and provides additional details about the address's purpose and routability. For subnet calculations with validated addresses, use our subnet calculator.
Validation Rules
IPv4: Four decimal numbers (0-255) separated by dots. Leading zeros are allowed but discouraged.
IPv6: Eight groups of 4 hex digits separated by colons. Consecutive zero groups can be compressed with ::.
IPv4 Address Types
Public Addresses
Public IP addresses are globally routable on the internet. They're assigned by IANA through regional registries and ISPs. Examples include 8.8.8.8 (Google DNS) and 1.1.1.1 (Cloudflare DNS).
Private Addresses (RFC 1918)
Reserved for internal networks, these addresses are not routed on the public internet:
- 10.0.0.0/8 - 10.0.0.0 to 10.255.255.255 (16 million addresses)
- 172.16.0.0/12 - 172.16.0.0 to 172.31.255.255 (1 million addresses)
- 192.168.0.0/16 - 192.168.0.0 to 192.168.255.255 (65,536 addresses)
Loopback (127.0.0.0/8)
The loopback range (most commonly 127.0.0.1) is used for a device to communicate with itself. Packets sent to loopback addresses never leave the host.
Link-Local (169.254.0.0/16)
Automatically assigned when DHCP fails (APIPA). These addresses are only valid on the local network segment and are not routed.
Multicast (224.0.0.0/4)
Used to send data to multiple recipients simultaneously. Ranges from 224.0.0.0 to 239.255.255.255.
IPv4 Classes
| Class | Range | First Bits | Default Mask | Purpose |
|---|---|---|---|---|
| A | 1.0.0.0 - 126.255.255.255 | 0 | /8 | Large networks |
| B | 128.0.0.0 - 191.255.255.255 | 10 | /16 | Medium networks |
| C | 192.0.0.0 - 223.255.255.255 | 110 | /24 | Small networks |
| D | 224.0.0.0 - 239.255.255.255 | 1110 | N/A | Multicast |
| E | 240.0.0.0 - 255.255.255.255 | 1111 | N/A | Reserved/Experimental |
IPv6 Address Types
- Global Unicast (2000::/3) - Publicly routable addresses
- Link-Local (fe80::/10) - Auto-configured, local segment only
- Unique Local (fc00::/7) - Private addresses (like RFC 1918)
- Multicast (ff00::/8) - One-to-many communication
- Loopback (::1) - Device self-communication
For detailed IPv6 subnet calculations, use our IPv6 subnet calculator.
Common Validation Errors
- Octet out of range: IPv4 octets must be 0-255. "256.1.1.1" is invalid.
- Wrong number of octets: IPv4 needs exactly 4. "192.168.1" is invalid.
- Invalid characters: Only digits and dots for IPv4, hex and colons for IPv6.
- Multiple :: in IPv6: The compression shorthand can only appear once.
- Too many IPv6 groups: Maximum 8 groups when fully expanded.
For more IP-related tools, explore our CIDR calculator, network address calculator, and IP binary converter.