IP Subnet Calculator
Calculate IPv4 and IPv6 networks, split subnets, plan VLSM and convert CIDR masks.
Calculate an address to see this section.
How subnetting works
A prefix such as /24 says how many leading bits identify the network. The remaining bits identify an address inside it. For IPv4, the subnet mask is those network bits set to one. The wildcard mask is the inverse, and it is the value used in some access lists.
The network address has every host bit set to zero. The broadcast address has every host bit set to one. Addresses between them can be assigned to hosts. A /31 is the exception defined by RFC 3021: both addresses are usable on a point-to-point link. A /32 names one host. IPv6 has no broadcast address, so the range runs from the network address through the last address of the prefix.
VLSM means the subnets inside a parent do not have to be the same size. This calculator sorts the requirements from largest to smallest, gives each the smallest legal block, and places that block on the next correctly aligned boundary. Splitting into equal pieces is separate: three requested subnets become four, because address blocks come in powers of two.
Class A, B and C describe the old default sizes /8, /16 and /24. The class is shown for reference. The network numbers come from the prefix you enter. Nothing you type is sent to a server. For the location of a public address, use IP Lookup.
Questions
Which address do I type?
Type any address in the subnet, or the network address itself. 192.168.1.100/24 and 192.168.1.0/24 describe the same network. The splitting and VLSM forms ask for the network address and reject a host address instead of changing it.
Why is a /28 not enough for 15 hosts?
A /28 contains 16 IPv4 addresses. Two are the network and broadcast addresses, so 14 can be hosts. Fifteen hosts need a /27, which has 30 usable addresses. Two hosts are the one case that fits in a /31.
What is not calculated?
Zone identifiers such as %eth0 are rejected. Equal-sized subnet lists stop at 2,048 rows so the page stays usable. VLSM planning is IPv4. IPv6 counts include the subnet-router anycast address rather than removing it.