IPv4 Subnet Calculator (CIDR)

Get the network address, broadcast address, usable host range, and mask for any IPv4 CIDR block — instantly.

Enter a network

Examples: 10.0.0.0/8, 172.16.5.100/22, 192.168.1.0 255.255.255.0

Subnet details

Network address
Broadcast address
First usable host
Last usable host
Subnet mask
Wildcard mask
CIDR
Usable hosts

Binary breakdown

IP
Mask
Network

Common CIDR prefix lengths

PrefixSubnet maskAddressesUsable hostsTypical use
/8255.0.0.016,777,21616,777,214Large enterprise / RFC1918 (10.0.0.0/8)
/16255.255.0.065,53665,534Campus / RFC1918 (192.168.0.0/16)
/22255.255.252.01,0241,022Large office
/24255.255.255.0256254Standard LAN subnet
/26255.255.255.1926462Small VLAN
/28255.255.255.2401614Small IP block (DMZ, small VLAN)
/29255.255.255.24886Server rack / infrastructure
/30255.255.255.25242Point-to-point link
/31255.255.255.25422*PtP link (RFC 3021)
/32255.255.255.25511Single host / loopback

Reserved private ranges (RFC 1918)

Fast way to size a subnet

You need N hosts. Round up to a power of 2, then add 2 for the network + broadcast. The prefix length is 32 - log₂(size). Or just use the table above — 14 hosts fit in /28, 30 hosts in /27, 60 hosts in /26, and so on.

FAQ

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) writes a subnet as an IP followed by a slash and the prefix length — e.g. 192.168.1.0/24. The prefix length is how many bits from the left are the network portion; the rest are hosts. /24 means 24 network bits + 8 host bits = 256 total addresses.

Why are there 2 fewer usable hosts than addresses?

In IPv4, the first address (all host bits 0) is the network address and the last (all host bits 1) is the broadcast address — neither can be assigned to a host. So a /24 with 256 addresses gives you 254 usable IPs. /31 and /32 are special cases (RFC 3021 point-to-point links).

What's the difference between subnet mask and wildcard mask?

The subnet mask has 1s in network bits and 0s in host bits (e.g. 255.255.255.0). The wildcard mask is its inverse — 0s in network bits and 1s in host bits (e.g. 0.0.0.255). Cisco ACLs use wildcard masks; most other tools use subnet masks.

How do I pick the right subnet size?

Count your hosts, add ~20% headroom, then find the smallest prefix that fits: /30 = 2 usable, /29 = 6, /28 = 14, /27 = 30, /26 = 62, /25 = 126, /24 = 254. For point-to-point links use /30 (or /31 if your router supports RFC 3021).