[ N.4 — SUBNET CALCULATOR ]

Subnet math,
made painless.

CIDR (Classless Inter-Domain Routing) notation describes an IP range as address/prefix, where the prefix says how many leading bits are fixed as the network portion. This calculator returns the network, broadcast, host range, mask and binary for any IPv4 or IPv6 block, plus VLSM and a prefix cheat sheet.

Corrections welcome — see our editorial policy.

// Everything runs locally in your browser — nothing is sent to our servers.
// cidr calculator
Try:
Enter a CIDR block above to calculate.
Network Address
Broadcast Address
First Host
Last Host
Total Addresses
Usable Hosts
Subnet Mask
Wildcard Mask
// vlsm calculator IPv4
Subnet name Hosts needed
// prefix cheat sheet REFERENCE

IPv4 prefix lengths

PrefixMaskAddressesUsableClass

IPv6 prefix lengths

PrefixTypical use
// cidr
// full breakdown —
Network Address
Broadcast Address
First Usable Host
Last Usable Host
Total Addresses
Usable Hosts
Subnet Mask
Wildcard Mask
Prefix Length
IP Version
Network Address (Binary)
Subnet Mask (Binary)
// vlsm allocation —
Name Hosts needed Allocated Network Prefix Range Broadcast Mask
Address space — total
Subnets requested
Addresses used
Addresses remaining
// explainer

How do CIDR and VLSM
shape a subnet?

CIDR (Classless Inter-Domain Routing) is a compact notation for describing an IP range as address/prefix. Where the prefix is a number from 0 to 32 (IPv4) or 0 to 128 (IPv6) that tells you how many bits are fixed as the network portion and how many are free for host addresses.

The prefix length determines the block size. A /24 fixes 24 bits, leaving 8 for hosts (28 = 256 addresses, 254 usable after subtracting network and broadcast). A /16 fixes 16 bits: 65,536 addresses. Each step down in prefix length doubles the block: /23 is twice as large as /24, /22 four times, and so on. Before CIDR (pre-1993), the internet used a rigid "classful" system (Class A = /8, Class B = /16, Class C = /24) which wasted enormous swathes of address space.

VLSM (Variable Length Subnet Masking) is what you get when you subdivide a single allocation into smaller subnets of different sizes. Suppose you have 192.168.1.0/24 and need three networks: 50 hosts, 25 hosts, and 10 hosts. The math is: pick the smallest prefix that fits each, allocate them in decreasing order from the start of the block, and advance the pointer by the size of each allocation. The VLSM tab above does this automatically and shows exactly how the address space is carved up, including the remainder that's still free.

IPv6 CIDR works identically but with 128-bit addresses. A /48 is a typical site allocation: it leaves 80 bits for internal use, enough for 65,536 /64 subnets, each containing more addresses than the entire IPv4 internet. The /64 boundary is significant: SLAAC (stateless address autoconfiguration) requires it, so almost every end network is a /64 regardless of how many devices it actually has. IPv6 also has no broadcast address, which is why the "usable hosts" field is hidden for v6 results.

The address range type for IPv6 matters too. 2000::/3 is globally routable unicast (the "real" internet). fe80::/10 is link-local: valid only on the local segment, never routed. fc00::/7 is ULA (Unique Local Addresses) — the IPv6 equivalent of RFC 1918 private ranges. ff00::/8 is multicast, ::1/128 is loopback. We label the range type in the breakdown so you don't accidentally assign link-local addresses to a public-facing service.