Reading the slash
What does CIDR notation mean?
CIDR stands for Classless Inter-Domain Routing. It writes an IP address followed by a slash and a network prefix, such as 192.168.1.0/24. IPv4 addresses have 32 bits: /24 fixes the first 24 as network bits, leaving 8 bits to vary within the block. A larger prefix number means a smaller range.
The address count is 2^(32 - prefix), so a /24 contains 2^8 = 256 addresses. These prefix rules are defined in RFC 4632. Have a dotted-decimal mask instead? Use the subnet mask to CIDR converter to find its prefix.
Two useful directions
How to use the CIDR range calculator
CIDR to IP range
Enter notation such as 192.168.10.77/26. The calculator normalizes it to 192.168.10.64/26 and returns the range through 192.168.10.127.
IP range to CIDR
Enter inclusive start and end addresses. If one aligned block cannot represent the range, the calculator returns the smallest exact list of blocks.
From result to review
Convert an IP range into an exact allowlist
Suppose an internal service should accept source addresses from 192.168.1.5 through 192.168.1.20, and its address list accepts CIDR notation. This worked example shows how to describe those 16 addresses without including their neighbors. It is an address-list example, not a complete firewall configuration.
1. Load the example
Choose IP range to CIDR, enter 192.168.1.5 as Start IP and 192.168.1.20 as End IP, then select Convert to CIDR.
2. Why aren't 16 addresses one /28?
Size alone is not enough: a CIDR block must start on a matching binary boundary. Here, 192.168.1.0/28 covers .0 through .15, while 192.168.1.16/28 covers .16 through .31. Our range crosses that boundary, so neither block is an exact match.
The smallest single enclosing block, 192.168.1.0/27, covers 32 addresses. It adds 16 unwanted addresses: .0 through .4 (5 addresses) and .21 through .31 (11 addresses). Use all five exact blocks below when those neighbors must stay outside this address list.
3. Review the CSV coverage
Select Download CSV after calculating. These are the five data rows for this fixed example; editing the calculator does not change this walkthrough.
On narrow screens, scroll the table sideways to see all four columns.
| CIDR | First address | Last address | Address count |
|---|---|---|---|
192.168.1.5/32 | 192.168.1.5 | 192.168.1.5 | 1 |
192.168.1.6/31 | 192.168.1.6 | 192.168.1.7 | 2 |
192.168.1.8/29 | 192.168.1.8 | 192.168.1.15 | 8 |
192.168.1.16/30 | 192.168.1.16 | 192.168.1.19 | 4 |
192.168.1.20/32 | 192.168.1.20 | 192.168.1.20 | 1 |
Starting at each uncovered address, the calculator takes the largest aligned block that fits inside the remaining range. At .5, that is a single /32; at .6, a /31 fits; at .8, a /29 fits. At .16, another /29 would run through .23, so a /30 covers .16 through .19, leaving .20/32.
- Check the endpoints: the first row begins at
192.168.1.5and the last ends at192.168.1.20. - Check every join: each row starts immediately after the preceding row ends. In this example,
.5is followed by.6,.7by.8,.15by.16, and.19by.20. There are no gaps or overlaps. - Check the count:
1 + 2 + 8 + 4 + 1 = 16, matching the inclusive range size,20 - 5 + 1 = 16. A matching total alone is not enough; check the endpoints and joins too.
4. Use the export in the right format
- TXT: one CIDR per line, with no header, for a destination that accepts that format.
- CSV: the header and coverage columns shown above, for spreadsheet review or a change record. It is not a universal firewall import format.
Keep all five blocks to represent the complete range. Here, /31 and /32 describe address sets, not subnets being assigned to devices, so do not subtract network or broadcast addresses from the list.
Before applying a rule, check the destination's required syntax, source versus destination fields, ports, protocols, rule ordering, and existing permissions. This calculator verifies address coverage, not whether a firewall will allow or deny traffic. It does not inspect your configuration or test network reachability.
Block sizes at a glance
Common CIDR prefixes and IP ranges
Each example shows the complete, inclusive range. Select a CIDR block to load it in the calculator. Address counts are not usable-host counts.
| CIDR block | Start IP | End IP | Total addresses |
|---|---|---|---|
| 172.16.0.0 | 172.16.255.255 | 65,536 | |
| 192.168.1.0 | 192.168.1.255 | 256 | |
| 192.168.1.0 | 192.168.1.63 | 64 | |
| 192.168.1.0 | 192.168.1.3 | 4 | |
| 192.168.1.0 | 192.168.1.1 | 2 | |
| 192.168.1.9 | 192.168.1.9 | 1 |
For equivalent netmasks and wildcard masks, see the subnet mask reference table.
Ranges versus hosts
Which addresses can a device use?
This tool counts every address, including the network and final address. For assignable host ranges and broadcast details, use the IPv4 subnet calculator. A /31 can use both addresses on a point-to-point link under RFC 3021; a /32 identifies one address. Provider-specific reservations may further reduce the addresses available to devices.
Working with IPv6? Use the IPv6 subnet calculator; the converter on this page accepts IPv4 only.
How we check the calculations
Checks behind these results
Our automated tests check the examples on this page, host-address normalization, the full IPv4 /0 range, and single-address /32 ranges. Range tests check aligned boundaries, consecutive blocks without gaps or overlaps, and address-count totals. Export tests check the TXT and CSV contents, including this five-block example. Invalid addresses, unsupported IPv6 inputs, and reversed ranges are tested as errors.
These are specific regression checks, not an exhaustive test of every possible range or a certification of any firewall configuration. Use the coverage checklist above to review your own result before making a network change.
Common questions
CIDR and IP range FAQ
Can I calculate CIDR from an IP address alone?
An IP address alone does not tell you its network prefix. Supply the prefix or subnet mask from your network configuration, or enter the intended start and end addresses in IP range to CIDR mode. To represent only one address, use /32.
Can I combine separate allowed ranges by entering the lowest and highest IP?
Only if every address between those endpoints should be included. This calculator covers one continuous range, including both endpoints; it does not know about gaps you want to exclude. Convert separate allowed ranges individually so addresses in those gaps are not added to the allowlist.