CIDR Calculator
Turn a CIDR block into its IP range, or any start–end range into the minimal set of CIDR blocks for firewall rules and allow lists.
- CIDR → range
- Range → CIDR list
- Minimal blocks
- Copy as list
CIDR to IP range
- First address
- 10.20.0.0
- Last address
- 10.20.3.255
- Usable hosts
- 10.20.0.1 – 10.20.3.254
- Addresses
- 1,024
- Subnet mask
- 255.255.252.0
- Wildcard mask
- 0.0.3.255
IP range to CIDR
4 CIDR blocks cover exactly 11 addresses:
- 192.168.1.10/312 addresses
- 192.168.1.12/304 addresses
- 192.168.1.16/304 addresses
- 192.168.1.20/321 addresses
What is CIDR notation?
Classless Inter-Domain Routing (CIDR) writes a network as an address and a prefix length, such as 10.20.0.0/22, meaning the first 22 bits identify the network. This calculator converts both ways: a CIDR block into its first and last address and size, and an arbitrary range of addresses into the smallest list of CIDR blocks that covers it exactly, which is what firewalls, cloud security groups and allow lists need.
How to use the CIDR calculator
- Enter a CIDR block to see its first and last address and size.
- Or enter a first and last IP to get the CIDR blocks that cover that range.
- Copy the CIDR list into your firewall, security group or allow list.
- Check the warning if your CIDR address is not the network address.
Subnetting essentials
- Usable hosts = 2^(32 − prefix) − 2; the network and broadcast addresses are reserved.
- /31 links have 2 usable addresses (RFC 3021) and /32 is a single host.
- Private ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918).
- Wildcard mask = 255.255.255.255 − subnet mask, used in Cisco ACLs and OSPF.
Why use this cidr calculator
- Instant and exactResults update as you type, with copy buttons on every value.
- Learn as you goBinary view highlights the network and host bits so subnetting makes sense.
- Splitting built inDivide any network into equal smaller subnets and list each range.
- Nothing leaves your browserNetwork plans and internal addressing are calculated on your device, never logged by a server.
Common uses
- Firewall allow lists. Convert a vendor’s IP range into CIDR rules.
- Cloud security groups. AWS, Azure and GCP rules take CIDR blocks.
- GeoIP and blocklists. Turn start–end ranges into CIDR.
- Route summarisation. Check how ranges aggregate.
More network tools: convert addresses with the binary to decimal and hex to decimal converters, or test endpoints with the API tester. Browse all developer tools.
Example: 192.168.1.10 to 192.168.1.20
The 11 addresses become 4 CIDR blocks: 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/30 and 192.168.1.20/32.
What to expect from the result
This page calculates IPv4. Use the IPv6 subnet calculator for IPv6 prefixes. Cloud providers reserve extra addresses in each subnet (AWS reserves 5), so usable counts there are lower.
CIDR Calculator questions
How do I convert CIDR to an IP range?
The first address is the IP with the host bits set to 0; the last has them set to 1. 10.20.0.0/22 covers 10.20.0.0 to 10.20.3.255.
How do I convert an IP range to CIDR?
Enter the first and last IP. The calculator finds the smallest set of aligned power-of-two blocks that covers exactly that range.
Why does my range need several CIDR blocks?
CIDR blocks must start on a boundary that is a multiple of their size. Ranges that do not line up are covered by a few smaller blocks.
What does /32 mean?
A single IP address. /0 means every IPv4 address.
What subnet mask is /24?
255.255.255.0. A /16 is 255.255.0.0 and a /28 is 255.255.255.240.