Ad Space

IP Address & Prefix

Subnet Details

CIDR
Classification
Subnet Mask
Network Address
Broadcast Address
First Usable Host
Last Usable Host
Total Usable Hosts

IPv4 Address Classifications

RangeClassification
10.0.0.0 – 10.255.255.255Private
172.16.0.0 – 172.31.255.255Private
192.168.0.0 – 192.168.255.255Private
127.0.0.0 – 127.255.255.255Loopback
169.254.0.0 – 169.254.255.255Link-Local
224.0.0.0 – 239.255.255.255Multicast
240.0.0.0 – 255.255.255.255Reserved
Everything elsePublic
Ad Space

How CIDR Notation Works

CIDR (Classless Inter-Domain Routing) notation packs an IP address and its subnet size into one compact string: an IPv4 address, a slash, and a prefix length from 0 to 32, like 192.168.1.0/24. The prefix length is how many of the address's 32 bits are fixed as the "network" portion — the remaining bits are free to vary across every device (host) inside that network. A smaller prefix means fewer fixed network bits and more host bits, so it describes a larger network; a larger prefix means more fixed bits and fewer host bits, describing a smaller network. A /24 fixes the first 24 bits (the first three octets) and leaves 8 bits — 256 possible values — for hosts.

Worked Example: 192.168.1.0/24

With a /24 prefix, the subnet mask is 255.255.255.0 — the first three octets are all 1s in binary (fixed), the last octet is all 0s (free for hosts). Applying that mask to 192.168.1.0 gives a network address of 192.168.1.0 unchanged, since the host octet was already 0. The broadcast address — every host bit set to 1 — is 192.168.1.255. That leaves addresses 192.168.1.1 through 192.168.1.254 as usable host addresses: 254 of them, since the network and broadcast addresses themselves are reserved and not assignable to a device. In general, a prefix of length p leaves 32 − p host bits, giving 2^(32−p) total addresses and 2^(32−p) − 2 usable ones (for any prefix from 0 through 30).

The /31 and /32 Special Cases

Two prefix lengths break the "subtract 2 for network and broadcast" rule above, and both trip people up if they aren't expecting it. A /31 subnet has only 2 total addresses — too few to spare one for a network address and one for a broadcast address and still have anything left to assign. RFC 3021 solves this by defining both addresses in a /31 as usable host addresses, intended specifically for point-to-point links (like a connection between two routers) where exactly two devices need an address and no broadcast is needed anyway. A /32 goes further still: it's a single address with no room for any other host at all — it's used as a "host route," pointing to one specific device, where the one address serves as both the network identifier and the only host in the same breath.

IPv6 Addressing — 128-Bit Addresses and the /64 Standard

IPv6 addresses are 128 bits — four times the length of a 32-bit IPv4 address — written as eight groups of up to four hexadecimal digits separated by colons, like 2001:0db8:0000:0000:0000:0000:0000:0001. Since long runs of all-zero groups are common, "::" can replace exactly one such run (only once per address, or the compression would be ambiguous), shortening that same address to 2001:db8::1. Prefix length works the same underlying idea as IPv4 — how many leading bits are the fixed network portion — just on a 0-to-128 scale instead of 0-to-32. In practice, /64 is the near-universal standard for a single IPv6 subnet: it leaves a full 64 bits (the "interface identifier") for hosts, which is so far beyond what any real network needs that address exhaustion within a subnet is a non-issue — a deliberate design choice rather than a coincidence.

IPv6 also drops the IPv4 concept of a reserved broadcast address entirely. Every address in a subnet's range, including the first one (the network address), is a valid, assignable host address — multicast addresses (the ff00::/8 range) handle the "send to many recipients" job broadcast used to do in IPv4, without requiring every device on the subnet to process every broadcast packet.

Worked Example: 2001:db8::/64

With a /64 prefix, the first 64 bits (2001:0db8:0000:0000) are the fixed network portion, and the remaining 64 bits are free for hosts. The network address — every host bit set to 0 — is 2001:db8:: (the trailing zero groups compress away). The last address in the range — every host bit set to 1 — is 2001:db8::ffff:ffff:ffff:ffff. The total address count is 2^64, or 18,446,744,073,709,551,616 — a number so large it's rarely written out in full; it's simply treated as "effectively unlimited" for a single subnet. 2001:db8::/32 itself is reserved specifically for documentation and examples (RFC 3849), which is why it's the default value in this calculator's IPv6 tab instead of a real, routable address.

A Brief History of IP Addressing and Subnetting

The original Internet Protocol addressing scheme, defined in RFC 791 in 1981, divided the IPv4 address space into fixed classes — Class A, B, and C networks — each with a rigid, predetermined split between network and host bits. A Class C network, for example, always had exactly 8 host bits (254 usable addresses), whether an organization needed 5 addresses or 500, which wasted enormous blocks of address space as the internet grew far larger than its early-1980s designers had anticipated.

By the early 1990s, the internet was consuming address space and routing-table entries faster than the class system could sustain, prompting the IETF to replace it with Classless Inter-Domain Routing (CIDR) in 1993, documented in RFC 1519. CIDR's core idea — letting the network/host split fall at any bit boundary rather than only at the old fixed class boundaries — is exactly the prefix-length notation (/24, /30, and so on) this calculator works with, and it remains the addressing scheme underlying IPv4 networks today.

Common Subnetting Mistakes

Forgetting that the network and broadcast addresses aren't assignable to any device is the most common mistake — assigning 192.168.1.0 or 192.168.1.255 to a host on a /24 network will cause real connectivity problems, since routers and other devices treat those addresses specially. Confusing the prefix length with a subnet mask octet count is another — a /24 corresponds to 255.255.255.0, not "24" appearing anywhere in the mask itself, and the two representations need converting between, not reading interchangeably. And applying the usual "usable hosts = total minus 2" formula to a /31 or /32 gives a wrong (or even negative) answer — those two prefixes need the special-case handling covered above instead.

Subnetting Terms You Should Know

CIDR — Classless Inter-Domain Routing, the address/prefix-length notation (e.g. /24) used to describe a subnet's size without a separate, spelled-out subnet mask.

Subnet Mask — a 32-bit value, written in dotted-decimal form, that marks which bits of an address are the fixed network portion versus the free host portion.

Network Address — the first address in a subnet, with every host bit set to 0; identifies the subnet itself rather than any individual device.

Broadcast Address — the last address in a subnet, with every host bit set to 1; sending to it reaches every device on that subnet at once.

Host Bits — the address bits left unfixed by the prefix length, available to uniquely number each device on the subnet.

Interface Identifier — the IPv6 equivalent of "host bits," the portion of a /64 address (typically the last 64 bits) that identifies one specific interface within the subnet.

Unique Local Address (ULA) — the IPv6 equivalent of an IPv4 private address, in the fc00::/7 range; not routable on the public internet, used for internal networks.

Global Unicast Address — the IPv6 equivalent of an IPv4 public address, in the 2000::/3 range; routable on the public internet.

Frequently Asked Questions

What does CIDR notation mean?

CIDR notation writes an IP address followed by a slash and a number, like 192.168.1.0/24. The number is the prefix length — how many of the address's 32 bits are fixed as the network portion, with the rest available for host addresses.

How many usable hosts does a /24 network have?

A /24 leaves 8 bits for hosts, giving 256 total addresses. Subtract 2 for the network address and the broadcast address, leaving 254 usable host addresses.

What's special about a /31 subnet?

A /31 has only 2 addresses total. RFC 3021 defines both as usable host addresses on a point-to-point link, with no traditional broadcast address — unlike every other prefix, neither address is reserved.

What's special about a /32 subnet?

A /32 is a single-host route: it contains exactly one address, and that address serves as both the network address and the only host, commonly used to route to one specific device.

How is IPv6 different from IPv4?

IPv6 addresses are 128 bits instead of 32, written as eight hex groups instead of four decimal octets, and support "::" to compress consecutive zero groups. IPv6 also has no reserved broadcast address — every address in a subnet, including the first, is a usable host address.

Why is /64 the standard IPv6 subnet size?

A /64 leaves a full 64 bits for host addresses — far more than any real network will ever use — so it's the near-universal convention for a single IPv6 subnet, regardless of how many devices actually need an address.

Ad Space