IPv4/IPv6 Subnet Calculator

IPv4 / IPv6 Subnet Calculator

What Is CIDR Notation?

CIDR (Classless Inter-Domain Routing) notation, like 192.168.1.0/24, packs both an IP address and a subnet mask into one compact form. The number after the slash is the prefix length - how many leading bits of the address are fixed as the "network" portion. A /24 means the first 24 bits (three full octets) identify the network, leaving 8 bits (256 addresses) for hosts within it. Everything this tool computes - network address, broadcast address, usable host range, subnet mask - falls directly out of that one number using pure binary math, no external lookup needed.

IPv6 uses the exact same CIDR concept but with 128-bit addresses instead of 32-bit, so prefixes commonly range up to /64 or /128 rather than /32.

What This Calculator Shows

Network & BroadcastThe first and last address of the subnet - the boundaries that define the block.
Usable Host Range & CountThe addresses actually assignable to devices, excluding the network and broadcast addresses (IPv4) automatically.
Private / Special RangesFlags RFC 1918 private IPv4 ranges and IPv6 address types like link-local, unique local, and loopback.
IPv6 Expand & CompressShows both the fully expanded form and the shortest valid "::"-compressed form of an IPv6 address.

Frequently Asked Questions

Does this tool look up anything about my network online?

No - every calculation (network address, broadcast, host range, masks) is pure binary arithmetic done in your browser's JavaScript. Nothing about your IP or network is looked up externally or sent anywhere.

What if I don't type a CIDR prefix?

The tool defaults to /24 for IPv4 addresses and /64 for IPv6 addresses (the most common real-world defaults) if you leave off the "/prefix" part.

Why do /31 and /32 IPv4 subnets show a different usable range?

A /32 is a single host address with no room for a network/broadcast split. A /31 (2 addresses) is a special case defined by RFC 3021 for point-to-point links, where both addresses are usable as hosts instead of being reserved.

Does this fully validate every IPv6 address format?

It handles standard expanded and "::"-compressed notation with up to one "::" per address (per the IPv6 spec), which covers the vast majority of real-world addresses - embedded IPv4 (like ::ffff:192.0.2.1) and zone-index suffixes (%eth0) are not parsed.

Please cross-verify the result yourself. This calculator can make calculation mistakes, for example from rounding, unusual inputs or a formula that does not match your case. Recalculate important figures by hand or with a second trusted tool before you rely on them for money, tax, health or other decisions.