Divide an IP network into subnets and view addressing details for each resulting subnet.
The subnet mask (from the CIDR prefix) is applied to the IP address with a bitwise AND to find the network address, and the inverse (wildcard) mask gives the broadcast address. Usable hosts equal the total addresses in the block minus the network and broadcast addresses — except /31 links (RFC 3021, 2 hosts) and /32 (a single host).
Network and broadcast address
network = ip AND mask ; broadcast = network OR NOT mask
Usable host count
hosts = 2^(32 − cidr) − 2
An IPv4 address is 32 bits. A subnet mask splits those 32 bits into a network portion and a host portion. Every address that shares the same network portion is on the same local network and can be reached without a router.
The mask is a run of 1-bits followed by a run of 0-bits, which is why 255.255.255.0 and /24 mean the same thing: 24 leading ones. The slash notation is called CIDR, and it is what routers, cloud consoles and firewall rules generally want. Dotted masks survive mostly in Windows dialogs and older equipment.
For 192.168.10.0/24:
192.168.10.0, the identifier for the subnet. Obtainedby ANDing any address in the block with the mask.
192.168.10.255, reaches every host at once.Obtained by ORing the network with the inverted mask.
192.168.10.1 to 192.168.10.254. Everything betweenthe two above.
254 here.
The first address names the network and the last is the broadcast, so neither can be assigned to a machine. There are two exceptions worth knowing:
giving 2 usable hosts from 2 addresses. Widely used on router-to-router links.
address in an ACL or route table.
| CIDR | Mask | Total | Usable | Typical use |
|---|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point links |
| /29 | 255.255.255.248 | 8 | 6 | Tiny device VLAN |
| /28 | 255.255.255.240 | 16 | 14 | Small server pool |
| /24 | 255.255.255.0 | 256 | 254 | Standard office LAN |
| /22 | 255.255.252.0 | 1024 | 1022 | Large flat network |
| /16 | 255.255.0.0 | 65536 | 65534 | Whole site or VPC |
Classes A, B and C fixed the network/host split at 8, 16 and 24 bits. That system was replaced by CIDR in 1993 because it wasted enormous quantities of address space — an organisation needing 300 addresses had to take a Class B of 65,536.
Classes survive in two places: as vocabulary ("it's a class C network", usually meaning a /24), and in the default masks some tools still assume. The class selector in this calculator exists for that reason. A prefix that disagrees with the address's historical class is completely legitimate under CIDR, which is why a mismatch here produces a note rather than an error.
10.0.0.0/8 — 16.7 million addresses172.16.0.0/12 — 1 million addresses192.168.0.0/16 — 65,536 addresses169.254.0.0/16 — link-local, self-assigned when DHCP fails127.0.0.0/8 — loopbackSeeing a 169.254.x.x address on a machine almost always means DHCP did not answer.
Size for the network you will have in three years, not the one you have today, and leave gaps between allocations so a block can grow without renumbering. Renumbering a live network is genuinely painful, and address space inside a private range is effectively free — being generous costs nothing.
For IPv6 planning, see the IPv6 subnet calculator.
The prefix is how many leading bits of the address identify the network. /24 means the first 24 bits are the network portion (mask 255.255.255.0), leaving 8 bits — 256 addresses, 254 usable — for hosts.
In a normal subnet the first address is the network identifier and the last is the broadcast address, so neither can be assigned to a host. A /31 is the exception, used for point-to-point links where both addresses are usable.
The wildcard mask is the bitwise inverse of the subnet mask. It's commonly used in access control lists (ACLs) and OSPF configuration on routers to match ranges of addresses.
It filters the subnet list to the prefixes that are valid for that class: /8–/30 for Class A, /16–/30 for Class B, /24–/30 for Class C. Choose "Any" to work in pure CIDR terms with every prefix from /0 to /32 available, including /31 point-to-point links and /32 host routes. If the address you enter doesn't match the class you picked, the result still calculates correctly and adds a note — modern CIDR routing doesn't require the two to agree.
They are two notations for the same thing. 255.255.255.0 and /24 both mean "the first 24 bits identify the network". Older equipment and Windows dialogs ask for the dotted mask; routers, cloud consoles and firewall rules usually want the CIDR prefix, so both are shown together.