CIDR / Subnet Calculator

Break a CIDR block into network, mask, broadcast, first/last and host count.

Open tool

Overview

The CIDR / subnet calculator breaks any IPv4 CIDR block into its constituent parts: network address, broadcast address, first and last usable host, subnet mask in dotted form, wildcard mask, total addresses, and usable host count. Paste 10.0.0.0/22 and every number you need for a firewall rule or a DHCP scope appears in one view.

Network engineers planning a deployment, cloud architects sizing a VPC, and students working through subnetting exercises all need a CIDR calculator that handles non-obvious prefixes like /31 and /32 correctly. Long-tail keywords covered: calculate subnet mask from CIDR notation, find first and last usable IP in a /24, and count hosts in an IPv4 subnet.

How it works

Classless Inter-Domain Routing notation, defined in RFC 4632, packs an IP address and its prefix length into a single string like 192.168.1.0/24. The prefix length counts the leading bits that identify the network; the remaining bits address hosts within it. A /24 reserves 24 network bits and 8 host bits, giving 256 total addresses — minus the network and broadcast addresses, that leaves 254 usable hosts.

Two edge cases trip people up. A /31 (RFC 3021) is legal for point-to-point links and has 2 addresses with no network/broadcast reservation. A /32 is a single host route — exactly one address, often used for loopback or for routing a specific IP through a tunnel.

Examples

  • 192.168.1.0/24 → mask 255.255.255.0, broadcast 192.168.1.255, 254 usable hosts.
  • 10.0.0.0/8 → mask 255.0.0.0, 16,777,214 usable hosts, the largest RFC 1918 block.
  • 172.16.5.32/30 → 4 addresses, first usable 172.16.5.33, last usable 172.16.5.34.
  • 203.0.113.5/31 → 2 addresses, both usable for a point-to-point link.

FAQ

Why are two addresses reserved in each subnet?

The all-zeros host portion is the network address; the all-ones portion is the directed broadcast. Neither can be assigned to a host on most networks. /31 and /32 are the documented exceptions.

Can a subnet span a non-byte boundary?

Yes. /25, /27, /30, and any non-byte-aligned prefix are perfectly valid — they just produce masks like 255.255.255.224.

What is the wildcard mask used for?

It is the bitwise inverse of the subnet mask. Cisco IOS access lists and OSPF area definitions take wildcards instead of subnet masks.

How do I split a block into smaller subnets?

Use the Subnet Divider tool — pick the new prefix length and it returns each child CIDR in order.

Try CIDR / Subnet Calculator

An unhandled error has occurred. Reload ×