Skip to main content
IP Range CalculatorPRO
IPv6 ToolsInstant Client-Side Tool

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.

Quick presets:

Calculated Boundaries & ParametersReady

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Host Range254

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.

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 ::).

  1. Enter an address

    Type any value, such as 192.168.1.1 or 2001:db8::1.

  2. Detect the family

    Dots only point to IPv4. Colons point to IPv6. An IPv6 value may end in an embedded IPv4 part.

  3. 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 ::.

  4. 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 octets

No leading zeros in strict mode.

IPv6 group rule

1–4 hex digits per group

Digits 0–9 and a–f, any case.

IPv6 compression rule

"::" appears at most once

Two "::" 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.

InputFamilyResultReason
192.168.1.1IPv4Valid4 octets, all ≤ 255
256.1.1.1IPv4InvalidOctet above 255
192.168.1IPv4InvalidOnly 3 octets
01.02.03.04IPv4InvalidLeading zeros (octal ambiguity)
2001:db8::1IPv6ValidCompressed form
2001:DB8::1IPv6ValidUppercase hex accepted
2001:db8:::1IPv6InvalidTriple colon
2001:db8::1::2IPv6InvalidMore than one "::"
2001:db8:0:0:0:0:0:0:1IPv6Invalid9 groups
12345::1IPv6InvalidGroup longer than 4 hex digits
2001:db8::g1IPv6InvalidNon-hex character "g"
::ffff:192.0.2.1IPv6ValidEmbedded IPv4 part
fe80::1%eth0IPv6ValidZone 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.