IPv4/IPv6 Subnet Calculator

The CIDR & Subnetting Guide

What a /24 or /64 prefix actually encodes, how the network and broadcast addresses fall out of it, and the special-case subnets worth knowing by heart.

Open IPv4/IPv6 Subnet Calculator

Reading a CIDR Prefix at a Glance

Every bit position in an address is either part of the fixed network portion or the variable host portion, and the prefix length is simply where that split happens. In 192.168.1.0/24, the first 24 bits (192.168.1) are fixed - every address in that block shares them - and the remaining 8 bits (0-255) identify an individual host. A smaller prefix (like /16) fixes fewer bits, meaning a much larger block of addresses; a larger prefix (like /28) fixes more bits, meaning a smaller block.

The same logic scales to IPv6's 128-bit addresses - a /64 prefix (extremely common for IPv6 subnets) fixes the first half of the address, leaving a full 64 bits (a genuinely enormous number of addresses) for the host portion within that one subnet.

Special-Case IPv4 Subnets Worth Knowing

Most IPv4 subnets reserve their first address (network) and last address (broadcast), leaving the rest usable - but two prefixes break that pattern deliberately. A /32 is a single address with no room for a network/broadcast split at all (used to describe one exact host). A /31, per RFC 3021, is a special case for point-to-point links (like a router-to-router connection) where BOTH of its two addresses are usable as hosts, since a broadcast address is meaningless on a link with only two devices on it.

Recognizing these two cases explains why a /31 or /32 in this tool's output looks different from every other prefix's usable-range calculation - it's not a bug, it's the actual defined behavior for those specific sizes.

Frequently Asked Questions

What's the difference between a subnet mask and a CIDR prefix?

They encode exactly the same information in two different notations - a subnet mask like 255.255.255.0 and a CIDR prefix like /24 both mean "the first 24 bits are the network portion". CIDR notation is more compact and is what this tool (and most modern tooling) uses natively.

Why do private networks (like 192.168.x.x) exist at all?

RFC 1918 reserves three address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) that are never routed on the public internet, specifically so organizations can use them internally without needing a unique public IP for every device - a router performing NAT translates between the private and public address spaces at the network edge.

Is IPv6 subnetting fundamentally different from IPv4 subnetting?

The underlying concept (fixed network bits, variable host bits) is identical - the practical difference is scale: IPv6's address space is so much larger that address exhaustion concerns mostly disappear, and a /64 (leaving 64 full bits for hosts) is the conventional minimum subnet size rather than something to conserve.

What's a "unique local" IPv6 address?

It's IPv6's rough equivalent of IPv4's private address ranges - addresses starting with fc00::/7 that are meant for use within a private network and aren't expected to be globally routable, similar in spirit to 192.168.x.x but for IPv6.

Open IPv4/IPv6 Subnet Calculator