IP Address Validator
Check IPv4 or IPv6 address syntax.
IP Address Validator: inputs and results
Enter an IP address, CIDR prefix, or range. Then check its first and last address below.
Calculated Boundaries & ParametersReady
Key Capabilities
- •100% Client-Side: Zero telemetry or server latency.
- •RFC Compliant: Exact 32-bit and 128-bit integer precision.
- •Quick Copy: Instant access to CIDR, mask, and range bounds.
- •Cross-Platform: Works on desktop, tablet, and mobile browsers.
Related IPv6 ToolsAll Tools
IPv6 Range Calculator
Find IPv6 prefix boundaries.
IPv6 Subnet Calculator
Calculate prefix details and address counts.
IPv6 /127 Link Planner
Divide a parent prefix into address pairs.
IPv6 /128 Address Calculator
Calculate single-address IPv6 prefix details.
IPv6 Binary Converter
Display address bits.
IPv6 Integer Converter
Convert IPv6 addresses to integer values.
How IP Address Validator Works?
The IP Address Validator works by detecting the address family from the separators, then applying the IPv4 rules (4 decimal octets) or the IPv6 rules (8 hex groups with at most one ::).
Enter an address
Type any value, such as
192.168.1.1or2001:db8::1.Detect the family
Dots only point to IPv4. Colons point to IPv6. An IPv6 value may end in an embedded IPv4 part.
Apply the family rules
IPv4 needs 4 octets from 0 to 255. IPv6 needs up to 8 groups of 1 to 4 hex digits and at most one
::.Report the result
The validator prints Valid or Invalid, the family, and the reason for any failure.
IP Address Validator Formula
The IP Address Validator formula is IPv4 valid = 4 octets AND each octet in 0–255; IPv6 valid = groups ≤ 8 AND each group ≤ 4 hex digits AND count("::") ≤ 1.
IPv4 octet rule
0 ≤ octet ≤ 255, 4 octetsNo leading zeros in strict mode.
IPv6 group rule
1–4 hex digits per groupDigits 0–9 and a–f, any case.
IPv6 compression rule
"::" appears at most onceTwo "::" make the address ambiguous.
IPv6 length rule
groups = 8, or < 8 with "::"An embedded IPv4 part counts as 2 groups.
Worked example: 2001:db8::1::2
Family = IPv6 (contains ":") Groups = 2001, db8, 1, 2 "::" count = 2 Result = Invalid (more than one "::")
IP Address Validator Conversion Table
The IP Address Validator conversion table checks 13 sample inputs across IPv4 and IPv6 and shows the family and reason for each result.
| Input | Family | Result | Reason |
|---|---|---|---|
| 192.168.1.1 | IPv4 | Valid | 4 octets, all ≤ 255 |
| 256.1.1.1 | IPv4 | Invalid | Octet above 255 |
| 192.168.1 | IPv4 | Invalid | Only 3 octets |
| 01.02.03.04 | IPv4 | Invalid | Leading zeros (octal ambiguity) |
| 2001:db8::1 | IPv6 | Valid | Compressed form |
| 2001:DB8::1 | IPv6 | Valid | Uppercase hex accepted |
| 2001:db8:::1 | IPv6 | Invalid | Triple colon |
| 2001:db8::1::2 | IPv6 | Invalid | More than one "::" |
| 2001:db8:0:0:0:0:0:0:1 | IPv6 | Invalid | 9 groups |
| 12345::1 | IPv6 | Invalid | Group longer than 4 hex digits |
| 2001:db8::g1 | IPv6 | Invalid | Non-hex character "g" |
| ::ffff:192.0.2.1 | IPv6 | Valid | Embedded IPv4 part |
| fe80::1%eth0 | IPv6 | Valid | Zone ID (RFC 4007) |
What is IP Address Validator?
The IP Address Validator is a tool that checks whether a string is a syntactically valid IPv4 or IPv6 address and names the address family.
IPv4 and IPv6 use different text formats. IPv4 uses 4 decimal octets separated by dots, defined in RFC 791. IPv6 uses up to 8 hexadecimal groups separated by colons, defined in RFC 4291, with the :: shorthand for 1 run of zero groups. The validator handles both in one field.
Strict validation rejects leading zeros in IPv4 octets. Some parsers read 010 as octal 8, which turns 010.0.0.1 into 8.0.0.1 and opens a path for filter bypasses.
What are the uses of IP Address Validator?
There are 5 main uses of the IP Address Validator, including form validation, API input checks, and log parsing.
Validating web forms
Signup and settings forms reject malformed addresses before saving.
Checking API inputs
APIs that accept addresses validate every request parameter.
Parsing log files
Log parsers separate valid addresses from corrupted fields.
Preventing filter bypasses
Strict IPv4 rules block octal and hex tricks such as
0x7f.1.Detecting address family
Dual-stack applications route IPv4 and IPv6 inputs to different code paths.