CalculatorNetworking
IPv4 CIDR calculator: address range, subnet mask and total count
Calculate an IPv4 range’s first and last addresses, subnet mask and total count locally from an address and prefix such as /24. CIDR fixes a prefix of the 32-bit address. The total is not a count of assignable hosts.
Calculate CIDR
IPv4 prefixes /0–/32; no leading zeros. Calculation runs locally.
Preparing the calculator. The fixed examples below remain readable.
Interpret the range for an address and prefix, explain how changing the prefix changes its size, and distinguish arithmetic from AWS allocation rules.
IPv4 is a 32-bit address written as four values from 0 to 255. The initial 192.0.2.17/24 is a documentation example; no network is probed.
A /24 fixes the first 24 bits
CIDR (Classless Inter-Domain Routing) writes an address followed by / and a prefix length. IPv4 has 32 bits: a /24 leaves eight variable bits, giving 2 to the eighth, or 256 combinations. A longer prefix leaves fewer variable bits and a smaller range.
- Network prefix: 24 bits
- 192.0.2 is fixed in this example; zeroing the remaining bits gives the start.
- Variable part: 8 bits
- The last octet ranges from 0 through 255: 256 addresses, not just the entered .17.
The entered IP need not be the range’s first address
| Field | Result | Meaning |
|---|---|---|
| First address / network | 192.0.2.0 | Keep the prefix and zero the variable bits |
| Last address | 192.0.2.255 | Set the variable bits to one |
| Subnet mask | 255.255.255.0 | 24 one bits followed by 8 zero bits |
| Total addresses | 256 | The combinations of the 8 variable bits |
192.0.2.17 is one address within the /24. Its network begins at 192.0.2.0. A difference between the entered address and network address is therefore expected.
Compare /24 and /25 for the same IP
| Input | Range | Total |
|---|---|---|
| 192.0.2.17/24 | 192.0.2.0–192.0.2.255 | 256 |
| 192.0.2.17/25 | 192.0.2.0–192.0.2.127 | 128 |
| 192.0.2.17/31 | 192.0.2.16–192.0.2.17 | 2 |
| 192.0.2.17/32 | 192.0.2.17 only | 1 |
| 192.0.2.17/0 | All IPv4 addresses | 4,294,967,296 |
Choose an option to see the result and explanation.
Input supported by this calculator
| Input | Calculator behavior |
|---|---|
| Four IPv4 values with /0 through /32 | Calculate range, mask and total |
| A /33 or an octet above 255 | Reject as invalid input |
| Leading zeroes such as 192.000.2.17 | Reject ambiguous notation |
| IPv6, hostnames and URLs | Not supported by this calculator |
The browser uses input for local arithmetic only: no saving, transmission, DNS lookup or connectivity test. Editing input asks you to calculate again; do not treat the previous range as the new input’s result.
Separate arithmetic totals from AWS assignable addresses
Normal AWS IPv4 subnets have /16 through /28 size constraints and reserve the first four and last addresses. A valid /32 or /0 arithmetic result does not establish that AWS accepts that subnet size. Separately review exceptions such as BYOIP.
Explain what changed in the result
- Calculate the start, end and total for 192.0.2.17/24.
- Change to /25 and explain why the total halves.
- Try /32 and compare its first and last addresses.
- Distinguish the arithmetic total from allocation rules in the intended environment.
Check, then explain in your own words
- Read the prefix and variable-bit count.
- Identify the range endpoints and mask.
- Do not equate total addresses with usable hosts.
Check your understanding: Does a total of 256 establish 256 assignable AWS addresses?
No. The total alone is insufficient.
AWS size and reservation rules are separate. The calculator does not determine provider-assignable counts or whether an API would accept a subnet.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- RFC 4632 — CIDRChecked:
Scope and conditionsIPv4 32-bit prefix notation, masks and total power-of-two address counts; not usable-host allocation rules.
Used in this lessonA /24 fixes the first 24 bits The entered IP need not be the range’s first address Compare /24 and /25 for the same IP
- VPC subnet CIDR blocksChecked:
Scope and conditionsAWS subnet size restrictions and reserved addresses differ from generic arithmetic
Used in this lessonSeparate arithmetic totals from AWS assignable addresses
Scope and conditions192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are documentation examples, not live networks
Used in this lessonSeparate arithmetic totals from AWS assignable addresses