CIDR / subnet calculator
Calculate IPv4 network, mask, broadcast and usable address range.
How to use
CIDR /24 means that 24 of the 32 IPv4 bits identify the network, leaving 8 host bits. A /24 therefore contains 256 addresses; in a conventional subnet, the network and broadcast addresses are reserved, leaving 254 usable host addresses.
Enter an IPv4 address with a prefix to calculate its network, mask, wildcard, broadcast and usable range. Planning modes can also divide a base network or find a prefix large enough for a requested number of hosts.
Not every range is yours to use. Three blocks are set aside for private networks by RFC 1918 — 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — and those are what an internal network is designed from. 100.64.0.0/10 belongs to carrier-grade NAT and will collide with the provider if borrowed; 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local and 224.0.0.0/4 is multicast. Picking a private range at random is how two networks end up unable to reach each other after a merger or over a VPN.
Two prefixes break the usual rule. A /32 is a single address with no network or broadcast at all, used for a route to one host. A /31 has two addresses and no broadcast either: RFC 3021 allows both to be used on a point-to-point link, which is why a /31 between two routers is not the mistake it looks like.
Example
192.168.1.42/24 belongs to network 192.168.1.0. It has 254 usable host addresses; 192.168.1.255 is the broadcast address.
192.168.1.42/24Network 192.168.1.0, broadcast 192.168.1.255, usable range .1–.254.192.168.1.70/26Network 192.168.1.64, broadcast 192.168.1.127, usable range .65–.126.10.0.0.1/8The largest private block: 16,777,216 addresses.198.51.100.1/31A point-to-point link. Two addresses, both usable, no broadcast.
Frequently asked questions
Why are two addresses usually not usable by hosts?
The first identifies the subnet and the last is its broadcast address. Point-to-point and special networks can follow different rules.
Which private range should I choose?
Avoid 192.168.0.0/24 and 192.168.1.0/24: they are the default on nearly every home router, so a VPN into an office that also uses one will clash with the network the user is sitting on. A rarely used 10.x block is the safer choice.
Does any of this apply to IPv6?
The prefix notation does, and little else. IPv6 has no broadcast address, so none is lost to it; a /64 is the normal size for a single network however few devices are on it, and fd00::/8 is the private range equivalent to RFC 1918.