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.
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.
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.
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.
- VLAN tagged vs untagged (access vs trunk) – how 802.1Q tags work on switched networks
- Cisco BGP multihoming with two ISPs – routing design that sits on top of your subnets
- Latency vs throughput vs bandwidth – why a working subnet can still feel slow
- Learn networking basics – the fundamentals behind IP addressing
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.
- Wi-Fi Channel Overlap Visualiser — Find the clearest Wi-Fi channel for your building.
- Who Is My ISP? — Your provider, public IP and ASN.
- CIDR to IP Range Converter — CIDR blocks to address ranges and back.
- Internet Speed Converter — Mbps, MB/s and transfer capacity.
