The IP subnet calculator, in the browser SUBNET
The calculator a network engineer keeps open all day. One bit wrong in a mask puts the hosts on the wrong network, so work it out exactly: networks, ranges, splits and VLSM, for IPv4 and IPv6.
Address and prefix
Split into equal subnets
VLSM plan
One segment per line, as "name 50": how many hosts each needs. They are packed into the block above, largest first.
How it works
Why a calculator
Subnetting is simple arithmetic that is unforgiving: one bit wrong in a mask and traffic goes nowhere. SUBNET does it exactly (32-bit for IPv4, 128-bit for IPv6), including the /31 and /32 special cases and VLSM packing, the part it is easiest to get wrong by hand. It never touches the network; it is pure arithmetic on what you type.
Questions people ask about SUBNET
What does a CIDR prefix such as /24 mean?
It is the number of leading bits of the address that name the network; the rest name a host on it. 192.168.1.10/24 says the first 24 bits, 192.168.1, are the network, which leaves 8 bits and 256 addresses. The prefix and the netmask say the same thing: /24 is 255.255.255.0, 24 ones followed by 8 zeros.
Each bit added to the prefix halves the block, so a /25 holds 128 addresses and a /23 holds 512.
Why is the usable host count two less than the total?
Because in an ordinary IPv4 subnet the first address is the network itself and the last is the broadcast address, and neither can be given to a host. A /24 has 256 addresses and 254 usable hosts.
The two exceptions are handled by their own rules. A /31 has no network or broadcast address and both addresses are usable, which is how point-to-point links are numbered under RFC 3021. A /32 is a single host.
What is a wildcard mask?
The netmask with every bit inverted: 255.255.255.0 becomes 0.0.0.255. A 1 in a wildcard means “this bit may be anything”. Cisco access lists and OSPF network statements are written with wildcards rather than netmasks, which is why the calculator shows both.
Can I type a netmask instead of a prefix?
Yes. Put the address and the mask with a space between them, as in 10.1.2.3 255.255.255.0, and it is read as 10.1.2.0/24. The mask has to be an unbroken run of ones followed by zeros; anything else is refused. An address on its own with no prefix is read as a single host, /32 for IPv4 and /128 for IPv6.
How does the VLSM plan decide where each subnet goes?
It sorts the segments by the hosts they need, largest first, gives each the smallest block whose usable count covers it, and places that block at the next address aligned to its size. Placing the largest first is what keeps the blocks from leaving gaps that nothing else can use. A segment that will not fit in what is left is marked as such, and the smaller ones after it are still tried.
The plan is listed in that largest-first order. A segment that needs exactly 2 hosts is given a /31, the point-to-point size; ask for 3 if it is a LAN that needs network and broadcast addresses.
Does it work for IPv6?
For working out a network, yes: type an address with a prefix, such as 2001:db8::1/64, and it gives the network, the last address, the total count, the address written in full and compressed, and its scope (global unicast, unique local, link-local and so on). IPv6 has no broadcast address, so there is no usable-host line.
Splitting and the VLSM plan are for IPv4 only. Addresses written with an embedded IPv4 part, such as ::ffff:192.0.2.1, are not accepted.
Is there a limit on how far a block can be split?
A split that would make more than 100,000 subnets is refused and you are asked to narrow it. Up to that, the count is given in full and the first 4,096 subnets are listed with their ranges and usable hosts.
Doing this often? OBSCURA Umbra edits a folder of code and configuration where it is, and runs JavaScript, TypeScript and Python over it in a sandbox. Everything is US$5 a month or US$48 a year.