How to use the subnet calculator
- Type an IPv4 address with a prefix, such as
10.20.30.40/27, or with a mask, such as10.20.30.40 255.255.255.224. - Select Calculate. Changing the prefix list recalculates straight away.
- To plan smaller networks, choose a new prefix length under Split into smaller subnets.
Worked examples
192.168.1.10/24: network 192.168.1.0, broadcast 192.168.1.255, 254 usable hosts from 192.168.1.1 to 192.168.1.254.10.20.30.40/27: network 10.20.30.32, broadcast 10.20.30.63, 30 usable hosts from 10.20.30.33 to 10.20.30.62.- Splitting
192.168.10.0/24into /26 gives four subnets of 62 usable hosts: .0, .64, .128 and .192.
What each result means
- Network address: the first address in the block, which identifies the subnet itself.
- Broadcast address: the last address, used to reach every host on the subnet.
- Subnet mask: the prefix written as four numbers; /24 is 255.255.255.0.
- Wildcard mask: the mask inverted, as used in Cisco access lists and OSPF network statements; /24 is 0.0.0.255.
- Usable hosts: normally the total minus the network and broadcast addresses. Two special cases: a /31 has two usable addresses for point-to-point links under RFC 3021, and a /32 is a single host.
- Address type: whether the address is private (RFC 1918), shared carrier-grade NAT space, documentation, multicast or another special-purpose range from the IANA registry, or public.
Choosing a subnet size
Size each VLAN for the devices it will hold in a few years, plus headroom: a /24 suits most office floors, a /26 or /27 suits a small branch or a server segment, and /30 or /31 suits router links. Separate guest, IoT, server and management networks rather than putting everything on one large subnet; our guide to network segmentation explains why.
Troubleshooting
- "Not a valid IPv4 address". Each part must be 0 to 255, without leading zeros: write
10.1.1.1, not10.01.1.1, because some systems read leading zeros as octal. - "Not contiguous". A mask such as 255.0.255.0 has no CIDR form; real subnet masks are all ones followed by all zeros.
- IPv6 addresses. This calculator handles IPv4 only. An IPv6 prefix of length n contains 2128−n addresses, and a /64 is the standard size for a single LAN segment.
Frequently asked questions
How many usable hosts are in a /24?
254. A /24 has 256 addresses; the first is the network address and the last is the broadcast address.
Why does a /31 show two usable hosts?
RFC 3021 allows /31 subnets on point-to-point links, where no network or broadcast address is needed, so both addresses are usable.
What is the difference between a subnet mask and a wildcard mask?
They are inverses. A subnet mask marks the network bits with ones; a wildcard mask marks the bits that may vary with ones, which is how Cisco access lists and OSPF match ranges.