Subnet Calculator (CIDR) for IPv4 and IPv6
Network, broadcast, range and host count from an address and mask.
Type an address with its prefix (192.168.1.10/24), with a mask (192.168.1.10 255.255.255.0), with a wildcard mask as access lists write it (0.0.0.255), or an IPv6 address (2001:db8::1/64). The prefix says how many of the address’s bits name the network; the rest number the devices on it. How it’s worked out: the mask is the prefix’s bits set to one. The network is the address AND the mask; the broadcast address is the network OR the wildcard (the mask turned over). An IPv4 network has 2^(32 − prefix) addresses, of which the first (the network) and the last (broadcast) can’t be given to a device, so there are two fewer hosts, except on a /31, a link between two routers (RFC 3021), and a /32, one address. IPv6 has no broadcast: every address in the range can be used, and a network has 2^(128 − prefix) of them, counted exactly however large. What the address is for (private, shared, documentation and so on) comes from the IANA special-purpose address registries. The classes A to E are the old pre-1993 scheme, still asked about in courses. ↑ and ↓ in the field, [ and ] elsewhere, or the slider make the prefix longer or shorter. Nothing is sent anywhere: your network’s layout stays on this device.
How to use Subnet calculator
- Type an IPv4 or IPv6 address with its prefix or mask, such as 192.168.1.10/24.
- Change the prefix with the slider, or ↑ and ↓ in the field, to make the network larger or smaller.
- Press Copy all to copy the network, broadcast, host range and masks.
Subnet calculator: common questions
Is it safe to put my network’s IP addresses into a subnet calculator?
With this subnet calculator it is: every figure is worked out in your browser, on your device, and nothing is sent anywhere, so your network’s layout stays private. It works offline too.
How many usable hosts are in a /31 or /32 subnet?
An IPv4 network has 2^(32 − prefix) addresses and two fewer usable hosts. A /31 is the exception: a link between two routers where both addresses are usable (RFC 3021). A /32 is a single address.
Does the subnet calculator work for IPv6?
Yes. Type an IPv6 address with its prefix, such as 2001:db8::1/64. IPv6 has no broadcast, so every address in the range is usable, and the subnet calculator counts the 2^(128 − prefix) addresses exactly, however large.
Everything stays on your device. Nothing is uploaded. Works offline once your first visit has stored the app.