IPv4 + IPv6 · calculations run locally in your browser

Subnet Calculator

Calculate IPv4 or IPv6 subnet boundaries, masks, address capacity and prefix details — then see exactly where an address sits inside its network.

Address family

Paste a full address like 192.168.1.37/24 or 2001:db8:1234:5678::10/64, or enter just the address for a default prefix.

Your subnet analysis will appear here.Enter an IPv4 or IPv6 address with a prefix to explore its network boundaries and capacity.

What is a subnet calculator?

A subnet calculator takes an IP address and a prefix length (or subnet mask) and works out the surrounding network: where it starts, where it ends, which addresses can be assigned to hosts, and how many addresses the block contains. It replaces manual binary arithmetic with an instant, verifiable answer for both IPv4 and IPv6.

How to use this subnet calculator

Type or paste an address into the field above, either on its own (for example 192.168.1.37) or with a CIDR prefix attached (192.168.1.37/24). IPv4 and IPv6 are detected automatically; use the IPv4/IPv6 toggle if you want to force one explicitly. If you prefer to enter a dotted-decimal subnet mask instead of a prefix, use “Enter IP, mask and prefix separately” — the two stay in sync. The Nearby Prefixes and Network Boundaries sections below let you explore how the result changes without retyping anything.

CIDR notation

CIDR (Classless Inter-Domain Routing) notation writes a network as an address followed by a slash and the number of bits reserved for the network portion, such as /24. It replaced the older fixed Class A/B/C system, allowing subnets of any size rather than only the three classful defaults.

Subnet mask vs. CIDR

A CIDR prefix and a dotted-decimal subnet mask describe the same thing two different ways. /24 and 255.255.255.0 are equivalent: both mean the first 24 bits identify the network and the remaining 8 identify hosts within it. This calculator keeps both representations in sync automatically, and shows the full conversion — mask, wildcard and binary — in Prefix Equivalents above.

Network address and broadcast address

The network address is the first address in a subnet, with all host bits set to zero; it identifies the subnet itself and is never assigned to a host. In IPv4, the broadcast address is the last address in the subnet, with all host bits set to one, used to reach every host on that subnet at once. IPv6 has no broadcast address at all — multicast is used instead.

Usable host addresses

For a typical IPv4 subnet, usable host addresses are every address between the network and broadcast address, which is the total address count minus two. A /24 has 256 total addresses and 254 usable hosts; a /30 has 4 total and 2 usable. This rule does not apply to /31 or /32, covered below.

Wildcard masks

A wildcard mask is the bitwise inverse of a subnet mask, used by access control lists and some routing configuration instead of a subnet mask. Where a subnet mask marks network bits with 1s, a wildcard mask marks them with 0s: the wildcard mask for 255.255.255.0 is 0.0.0.255.

/31 point-to-point networks

A /31 is still a valid two-address network prefix, for example 10.0.0.0/31. Under RFC 3021, point-to-point links (such as router-to-router WAN links) don’t reserve one address as the network address and one as the broadcast address the way a normal subnet would; instead, both addresses are assigned directly to the two link endpoints.

/32 host prefixes

A /32 is a single-address IPv4 prefix: all 32 bits belong to the prefix, leaving zero host bits. It is commonly used for host routes and loopback addresses, where a single address needs to be referenced or routed on its own rather than as part of a larger block.

IPv4 vs. IPv6 subnetting

IPv4 subnetting reserves a network and (usually) a broadcast address out of a comparatively small 32-bit space. IPv6 uses a vastly larger 128-bit address space, has no broadcast address, and is typically subnetted in much larger blocks — a /64 is the standard size for a single network segment, since IPv6 host addressing (SLAAC) expects a 64-bit interface identifier. The point-to-point exception that /31 provides for IPv4 has an IPv6 equivalent in /127, standardized by RFC 6164.

Why network boundaries fall where they do

Every valid subnet begins on an address that's an exact multiple of its own size, because a prefix's block size is always a power of two. The Network Boundaries section above shows this directly: for a given prefix, it lists the sequence of valid network starting points in whichever octet the prefix actually affects — the last octet for prefixes like /25–/30, but an earlier octet for prefixes like /12, /18 or /20.

IPv4 CIDR cheat sheet

Standard IPv4 prefixes from /8 through /32, with dotted-decimal mask, total address count, and traditional usable host count. /31 and /32 are shown with their real, non-traditional usable counts rather than a misleading “total minus two”.

CIDRSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (RFC 3021, point-to-point)
/32255.255.255.25511 (host route)

Worked examples

Select any example to load it into the calculator above.

Related network tools

This calculator analyzes one subnet in depth. For other network planning tasks: