Subnet Calculator: IPv4, IPv6, VLSM & Wildcard

Work out the network, broadcast, host range, wildcard mask and usable addresses for any IPv4 or IPv6 address — and split a network into VLSM subnets. Everything runs in your browser; nothing is sent anywhere.

Quick answer

IPv4: the network address is the IP with all host bits set to 0, and the broadcast is the IP with all host bits set to 1. Usable hosts are everything between them (total addresses minus 2). IPv6: there is no broadcast, so all addresses in the prefix are usable — including the subnet-router anycast address, which is simply the first address in the block.

IPv4
IPv6
VLSM split

Give a parent network and the host counts you need, one per line. Subnets are allocated largest-first, which is what makes VLSM efficient.

How subnetting maths works

A prefix length (/24) counts the leading network bits; the remaining bits are the host part. For IPv4, usable host addresses = 2(32 − prefix) − 2, because the first address identifies the network and the last is the broadcast. For IPv6, usable addresses = 2(128 − prefix) with no subtraction, since IPv6 has no broadcast address. The wildcard mask is simply the IPv4 mask inverted — useful for configuring ACLs and OSPF.

Cite this tool

Subnet Calculator (IPv4, IPv6, VLSM and Wildcard) — Afroz Ahmad. Available at afrozahmad.com/subnet-calculator/.

Suggested attribution: “Source: Afroz Ahmad, Subnet Calculator (IPv4, IPv6, VLSM and Wildcard) (https://afrozahmad.com/subnet-calculator/).”

Free to use and free to cite. No sign-up required.

Related reading on this site

Reviewed and fact-checked on 24 September 2026.

How do I calculate a subnet from an IP address?

Take the IP address and the prefix length (for example 192.168.1.10/24). The prefix tells you how many leading bits are the network part; the rest are host bits. The network address is the IP with every host bit set to 0, and the broadcast address is the IP with every host bit set to 1. Everything between those two is usable for devices. Enter the address above and the calculator does it instantly, including the mask and wildcard.

What is the difference between a subnet mask and a wildcard mask?

They are exact opposites. A subnet mask uses 1s for the network bits and 0s for the host bits: /24 is 255.255.255.0. A wildcard mask inverts that, using 0s for the network bits and 1s for the host bits: /24 becomes 0.0.0.255. Subnet masks configure interfaces; wildcard masks are used in ACLs and OSPF network statements to match a range of addresses.

How many usable hosts are in a /24 subnet?

A /24 leaves 8 host bits, so it contains 2 to the power of 8, which is 256 addresses in total. Two of those are reserved: the first is the network address and the last is the broadcast address. That leaves 254 usable host addresses. The same rule generalises: usable hosts equal 2 to the power of the number of host bits, minus 2.

What is VLSM and why does it matter?

VLSM stands for Variable Length Subnet Masking: instead of giving every subnet the same size, you allocate each one the smallest block that fits its requirement. A point-to-point link needs only a /30, while a floor of 100 users needs a /25. This stops you wasting large blocks on tiny links, which matters because IPv4 address space is finite. The VLSM section above allocates largest-first, which is the ordering that keeps a plan tight.

Does this calculator work for IPv6 as well as IPv4?

Yes. The IPv6 section returns the network prefix, the expanded and compressed forms, the first and last address, the interface identifier, the total number of addresses in the block and the address type (global unicast, unique local or link-local). Note there is no broadcast address in IPv6, so every address in the prefix is usable, and prefixes longer than /64 break SLAAC autoconfiguration.

More free tools

All eight run in your browser. Nothing you type is stored or sent anywhere.

See all eight tools →