Enter a CIDR range and get the network and broadcast address, the first and last host and the number of hosts.
What the CIDR calculator does
Enter a range in CIDR notation, like 192.168.10.0/24 or 2001:db8::/48. The calculator shows the network address, the first and last address, the broadcast address for IPv4, the netmask and wildcard mask, and how many addresses the range holds. It runs in your browser.
How CIDR works
The number after the slash is how many leading bits are fixed. An IPv4 /24 fixes 24 of 32 bits and leaves 8, so it holds 2 to the 8th, which is 256 addresses. Each step down doubles the size: a /23 holds 512 and a /22 holds 1,024.
In a normal IPv4 subnet the first address names the network and the last is the broadcast address, so a /24 has 254 usable hosts. /31 and /32 are the exceptions. RFC 3021 allows both addresses of a /31 on point-to-point links, and a /32 is a single host.
When you need it
- Writing SPF ip4 and ip6 entries. ip4:203.0.113.0/24 covers 256 addresses and costs no DNS lookup.
- Reading a provider's published IP ranges or a DMARC report source.
- Setting firewall rules and allowlists.
- Planning subnets for a network.
Why it matters for cold email
SPF flattening turns includes into ip4 and ip6 ranges written in CIDR. Get a prefix length wrong and you either leave out real sending servers, so their mail fails SPF, or you authorize a far bigger block than you meant to, so strangers' servers can pass as you. Check every range before it goes into a record.
Questions
What does /24 mean in an IP address?
The first 24 bits are the network part, which leaves 8 bits for hosts. In IPv4 that's 256 addresses, for example 192.168.1.0 to 192.168.1.255, with 254 usable for hosts.
How many IP addresses are in a /16?
65,536, which is 2 to the 16th. Each bit removed from the prefix doubles the count.
What is a wildcard mask?
The inverse of the netmask. A /24 has the netmask 255.255.255.0 and the wildcard mask 0.0.0.255. Cisco access lists and some firewalls use wildcard masks instead of netmasks.
Can I use CIDR ranges in an SPF record?
Yes. ip4:198.51.100.0/24 or ip6:2001:db8::/32 authorize the whole range, and neither costs a DNS lookup. Without a prefix, ip4 means a single address.
How big is an IPv6 /64?
2 to the 64th addresses, about 18 quintillion. A /64 is the standard size for one IPv6 subnet, and providers often give a site a /56 or a /48.