Subnet & VLSM calculator

A CIDR block, an address with a mask (10.0.0.1 255.255.255.0), or a bare address — which is read as /24 for IPv4 and /64 for IPv6.

Network address192.168.1.0
Broadcast address192.168.1.255
First host192.168.1.1
Last host192.168.1.254
Usable hosts254
Total addresses256
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
CIDR192.168.1.0/24
RangePrivate (RFC 1918)
Network (binary)11000000.10101000.00000001.00000000
Mask (binary)11111111.11111111.11111111.00000000

This calculator runs entirely in your browser. Nothing you type is sent to intSignal or anywhere else, and no part of it needs a network connection once the page has loaded.

Reading the output

A subnet is a range of addresses described by where it starts and how many bits of the address are fixed. Everything else — the broadcast address, the host range, the mask — follows from those two facts.

Network address

The first address in the block, with every host bit set to zero. It names the subnet rather than any device on it, and cannot be assigned to a host.

Broadcast address

The last address, with every host bit set to one. Traffic sent to it reaches every host on the segment, so it is also not assignable. A /31 and a /32 have none.

Subnet mask

The same prefix length written as four octets. A valid mask is always a run of ones followed by a run of zeros — 255.0.255.0 is not a mask, and this calculator rejects it rather than producing an answer for it.

Wildcard mask

The bitwise inverse, used by Cisco access lists and OSPF network statements. Where a subnet mask marks the bits that must match, a wildcard marks the bits that may vary.

Planning with VLSM

Carving a block into equal subnets is simple and usually wasteful. A segment with four devices and a segment with four hundred rarely deserve the same allocation.

Variable-length subnet masking sizes each block to its requirement. The planner above takes a parent block and a list of host counts and allocates in descending size order, which is the part that is easy to get wrong by hand: fitting a small subnet into the start of the space first leaves holes that nothing larger can occupy, and the plan runs out of room while appearing to have space left.

Each row shows what was asked for, what the block actually provides, and the difference. A large spare figure is not automatically waste — leaving room to grow is often deliberate — but it is worth seeing rather than discovering later.

Common questions

Why does a /24 have 254 usable hosts and not 256?

Two addresses in every ordinary IPv4 subnet are reserved: the first identifies the network itself, and the last is the broadcast address. Neither can be assigned to a host, so a /24 gives 256 total addresses and 254 you can use. The exceptions are /31 and /32, which this calculator handles separately.

What is a /31, and why does it show two usable hosts?

RFC 3021 allows a /31 on point-to-point links, where there is no need for a broadcast address because there is exactly one other device. Both addresses are assigned to hosts. A calculator that blindly subtracts two reports zero usable hosts for a /31, which is wrong and would rule out a configuration that is standard on router-to-router links.

What is VLSM, and why does the order of allocation matter?

Variable-length subnet masking means giving each segment a subnet sized to what it actually needs, rather than carving everything into equal blocks. The order matters because allocating a small subnet into the front of the space first leaves gaps too small for anything large. Allocating largest first packs the space without stranding it — which is what this planner does, regardless of the order you enter the segments in.

Why is the wildcard mask the inverse of the subnet mask?

A subnet mask marks the bits that must match; a wildcard mask, used in Cisco access lists and OSPF statements, marks the bits that may vary. They are bitwise inverses of each other, so 255.255.255.0 becomes 0.0.0.255.

How many addresses does an IPv6 prefix hold?

More than is useful to think about in those terms: a /64 holds 18,446,744,073,709,551,616 addresses. The figure that matters when planning is how many /64s a prefix contains, because a /64 is the standard size for a single network segment. A /48 holds 65,536 of them, which is why a /48 is a common allocation for a site.

Is anything I type here sent to intSignal?

No. The calculator is JavaScript that runs in your browser, and the arithmetic needs no server. Once the page has loaded you could disconnect from the network and it would still work. Addressing plans are sensitive, and most online subnet calculators submit them to a server — this one has nothing to submit them to.