Subnet calculator

Type an address such as 192.168.1.10/24 or 10.0.0.5 255.255.0.0 and SubnetMath shows the network and broadcast addresses, subnet and wildcard masks, the first and last usable hosts and how many there are, with the binary underneath.

Binary

Split into subnets

    VLSM: hosts per subnet

    HostsSubnetRangeUsable

    IP range to CIDR

    –

    Subnet mask cheat sheet (/0 – /32)
    CIDRSubnet maskWildcardAddressesUsable hosts

    Saved you some time? Leave a tip, entirely optional.

    Split networks, plan VLSM subnets and turn IP ranges into CIDR blocks below.

    How IPv4 subnetting works

    An IPv4 address is a 32-bit number, written as four 8-bit octets such as 192.168.1.10. A subnet divides those bits into two parts: the network bits, which are the same for every device on the subnet, and the host bits, which identify each device. The prefix length in CIDR notation, such as /24, says how many bits belong to the network. The subnet mask expresses the same thing in dotted-decimal form, with ones for network bits and zeros for host bits: /24 is 255.255.255.0. SubnetMath applies the mask to your address to find the network address (all host bits zero) and the broadcast address (all host bits one), and everything in between is the usable host range.

    Counting hosts

    A prefix of /n leaves 32 − n host bits, so the subnet contains 2^(32 − n) addresses. Two of them, the network and broadcast addresses, are normally reserved, so a /24 has 256 addresses and 254 usable hosts, a /26 has 64 and 62, and a /30 has 4 and 2. RFC 3021 allows /31 networks on point-to-point links with both addresses usable, and a /32 is a single host, often used for loopbacks and host routes.

    Splitting networks and VLSM

    Borrowing host bits creates smaller subnets: a /24 split into /26 networks gives four subnets of 64 addresses. With variable-length subnet masking you can give each subnet a different size, so a 100-host office gets a /25 while a 20-host lab gets a /27. Allocating the largest first keeps every block on its natural boundary and avoids overlaps. Cloud networks reserve a few extra addresses per subnet (AWS keeps five), so leave some headroom.

    Wildcard masks, ranges and special blocks

    A wildcard mask is the inverse of the subnet mask and is used in router access lists and OSPF. When a firewall needs CIDR blocks rather than a start and end address, the range converter finds the smallest set of aligned blocks that covers the range exactly. The calculator also flags private RFC 1918 addresses, loopback, link-local, carrier-grade NAT, multicast and documentation ranges so you can spot mistakes before they reach production. Everything runs in your browser and nothing you type is sent anywhere.

    Frequently asked questions

    Why are two addresses not usable?

    The first is the network address and the last is the broadcast address. /31 and /32 are exceptions.

    Does it support IPv6?

    This calculator covers IPv4. IPv6 uses the same prefix idea with 128-bit addresses.

    Is anything sent to a server?

    No. All calculations happen in your browser.

    Is SubnetMath free?

    Yes, with no sign-up or ads.

    Does it work offline?

    Yes, once the page has loaded.

    More tools