CIDR Validator
Check address and prefix syntax.
CIDR 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 IPv4 Subnetting & RangeAll Tools
IPv4 Range Calculator
Find address boundaries from a prefix.
IPv4 Subnet Calculator
Calculate subnet details from address and mask.
Network Address Calculator
Find the subnet’s network address.
IPv4 Broadcast Address Calculator
Find broadcast addresses where applicable.
First and Last Address Calculator
Identify a range’s endpoints.
Usable IPv4 Host Range Calculator
Apply the selected subnet-use rules.
How CIDR Validator Works?
The CIDR Validator works by running 5 checks on each entry: address format, octet range, prefix range, leading zeros, and boundary alignment. Each entry receives a Valid, Valid-not-aligned, or Invalid result.
Split the address and prefix
The validator splits
172.20.0.0/12at the slash into an address part and a prefix part.Check the 4 octets
Each octet must be a decimal number from 0 to 255 without leading zeros.
256and010both fail.Check the prefix
The prefix must be a whole number from 0 to 32.
Check alignment
The validator compares the address with
address AND mask. A mismatch means host bits are set, and the tool reports the aligned network.
CIDR Validator Formula
The CIDR Validator formula is Valid = (4 octets in 0–255) AND (0 ≤ p ≤ 32), and Aligned = (IP AND Mask) = IP.
Octet rule
0 ≤ octet ≤ 255Applied to all 4 octets.
Prefix rule
0 ≤ p ≤ 32IPv4 has 32 bits.
Alignment rule
(IP AND Mask) = IPTrue only when every host bit is 0.
Host bit test
(IP AND Wildcard) = 0An equivalent form of the alignment rule.
Worked example: 172.20.0.0/12
Octets 172, 20, 0, 0 → all within 0–255 ✓ Prefix 12 → within 0–32 ✓ Mask 255.240.0.0 → 20 AND 240 = 16 IP AND Mask = 172.16.0.0 ≠ 172.20.0.0 Result: valid syntax, not aligned → use 172.16.0.0/12
CIDR Validator Conversion Table
The CIDR Validator conversion table shows the result for 12 sample inputs, covering valid blocks, unaligned blocks, and 5 common syntax errors.
| Input | Result | Reason |
|---|---|---|
| 192.168.1.0/24 | Valid | Aligned to the prefix boundary |
| 192.168.1.10/24 | Valid, not aligned | Network is 192.168.1.0/24 |
| 172.16.0.0/12 | Valid | Aligned to the prefix boundary |
| 172.20.0.0/12 | Valid, not aligned | Network is 172.16.0.0/12 |
| 10.0.0.0/8 | Valid | Aligned to the prefix boundary |
| 10.0.0.0/33 | Invalid | Prefix above /32 |
| 256.1.1.0/24 | Invalid | Octet above 255 |
| 10.0.0/8 | Invalid | Not in a.b.c.d/p form |
| 192.168.010.0/24 | Invalid | Leading zero in an octet |
| 0.0.0.0/0 | Valid | Aligned to the prefix boundary |
| 203.0.113.64/26 | Valid | Aligned to the prefix boundary |
| 203.0.113.70/26 | Valid, not aligned | Network is 203.0.113.64/26 |
What is CIDR Validator?
The CIDR Validator is a tool that checks whether an IPv4 CIDR entry has correct syntax and whether its address sits on the prefix boundary.
CIDR notation joins an address and a prefix length with a slash, as in 192.168.1.0/24. Syntax errors break configuration imports, and unaligned entries such as 192.168.1.10/24 behave differently across platforms. Linux ip route rejects some of them, while other systems silently round the address down.
The CIDR Validator separates the 2 problems. A syntax error makes an entry unusable. An alignment issue makes the entry usable but ambiguous, so the validator prints the aligned network to use instead.
What are the uses of CIDR Validator?
There are 5 main uses of the CIDR Validator, including input sanitizing, configuration review, and bulk list cleanup.
Sanitizing form inputs
Web forms that accept network ranges check entries before saving, which stops values such as
10.0.0.0/33.Reviewing infrastructure code
Terraform and Ansible files hold dozens of CIDR strings. The validator catches unaligned blocks before
terraform apply.Cleaning allow-lists
Allow-lists copied from emails and tickets contain typos. The validator flags each broken line.
Checking routing announcements
BGP prefix filters require aligned prefixes. The validator confirms alignment before an announcement goes live.
Grading student answers
Instructors check whether a student wrote a valid, aligned network for a given prefix.