Subnet prefix length is the number of bits in an IP address that identify the network. Written after a slash — like /24 — it tells every device and router exactly where the network portion ends and where individual host addresses begin. In IPv4 it ranges from 1 to 32; in IPv6, from 1 to 128.
Why It Matters
Every IP address does two jobs at once: it identifies the network a device belongs to, and it identifies that specific device within the network. The subnet prefix length is what defines where one job ends and the other begins.
Without it, your router wouldn’t know whether to send a packet to another device on the local network or out to the internet. It’s a small number with a very specific job.
What “Prefix” Actually Means
Think of an IP address like a postal address. The city and state identify the general area — that’s the network. The street and apartment number identify the exact location — that’s the host.
The prefix length tells you how many bits from the left side of the address belong to the network part. In binary, an IP address is just a string of 1s and 0s. A /24 prefix means the first 24 bits are the network ID, and the remaining 8 bits identify individual hosts.
| Part | Example |
|---|---|
| Full IP address | 192.168.1.45/24 |
| Network portion (first 24 bits) | 192.168.1 |
| Host portion (last 8 bits) | 45 |
Prefix Length vs. Subnet Mask
Before CIDR notation became standard, networks used subnet masks — dotted-decimal numbers like 255.255.255.0. The subnet prefix length and the subnet mask say the same thing in different formats.
A 255.255.255.0 subnet mask has exactly 24 bits set to 1 — which is why it equals /24. Modern networking uses both interchangeably, but the slash notation is more common in routing tables and configuration files. The RIPE NCC guide on IP addressing has a thorough breakdown of how CIDR replaced the older classful system.
| Prefix Length | Subnet Mask | Usable Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /23 | 255.255.254.0 | 510 |
| /16 | 255.255.0.0 | 65,534 |
How to Calculate Usable Hosts
The subnet prefix length directly determines how many devices can exist on a network. The formula is:
2^(32 − prefix length) − 2
The −2 accounts for the network address (first IP in the range) and the broadcast address (last IP), which can’t be assigned to any device.
- /24: 2^8 − 2 = 254 usable hosts
- /25: 2^7 − 2 = 126 usable hosts
- /30: 2^2 − 2 = 2 usable hosts (used for point-to-point links between routers)
You can verify any prefix instantly with the Subnet Calculator — it shows the network address, broadcast address, and usable host range for any CIDR block without any manual math.
Prefix Length in IPv6
IPv6 works the same way, but the address is 128 bits long instead of 32. The most common IPv6 subnet prefix length is /64, which splits the address in half: the first 64 bits identify the network, and the last 64 bits are the interface identifier.
An address like 2001:db8:abcd:0012::/64 means the first 64 bits define the network, and the remaining 64 bits are available for hosts. That’s 2^64 possible host addresses per subnet — about 18 quintillion. ISPs typically assign /48 blocks to businesses and /64 blocks to home connections.
Real-World Examples
The examples below show how subnet prefix length controls network size in real deployments.
Home networks: Most home routers default to 192.168.1.0/24. That gives you 254 local device addresses — enough for every phone, laptop, TV, and smart plug in a typical household.
Office networks: A company might use /22 to support up to 1,022 devices, or split it into smaller /24 subnets per department to keep traffic organized and reduce broadcast overhead.
Point-to-point links: A /30 gives exactly 2 usable addresses — the minimum for a direct connection between two routers. No addresses go to waste.
Cloud infrastructure: AWS, Azure, and Google Cloud all use CIDR notation when defining VPC subnets. A /16 VPC gives 65,534 addresses to distribute across smaller subnets as needed.
Common Confusions
Three terms often get mixed up because they all describe network boundaries, just in different formats:
- Subnet mask (
255.255.255.0) — the traditional dotted-decimal format, still used in Windows network settings and older hardware - Prefix length (
/24) — the CIDR shorthand, standard in routing configs and modern tools - Wildcard mask (
0.0.0.255) — the bitwise inverse of the subnet mask, used in Cisco access lists and firewall rules
The subnet prefix length is simply the count of 1-bits in a subnet mask. That’s the entire relationship between the two formats — no special conversion, just counting.
FAQ
What does /24 mean in an IP address?
It means the first 24 bits identify the network. That leaves 8 bits for hosts, giving you 254 usable device addresses.
Is /24 the same as 255.255.255.0?
Yes. A subnet mask of 255.255.255.0 has exactly 24 bits set to 1, which is what /24 represents in CIDR notation.
What is the default prefix length for home networks?
Most home routers use a subnet prefix length of /24 (255.255.255.0), which supports up to 254 connected devices on the local network.
Can the prefix length be any number?
In IPv4, any value from 1 to 32. In IPv6, 1 to 128. Values below /8 or above /30 are uncommon for regular host networks in practice.
What’s the difference between a prefix and a prefix length?
A prefix is the full network address with the slash — like 192.168.1.0/24. The prefix length is just the number after the slash, which defines how many bits belong to the network portion.
The Short Version
Subnet prefix length is the number after the slash in an IP address. Smaller numbers mean larger networks with more hosts. Larger numbers mean smaller, more specific subnets.
To see how any prefix breaks down in practice — network address, broadcast address, and exact usable host range — the Subnet Calculator handles the math instantly. For checking DNS records alongside your network setup, the DNS Lookup Tool works directly from your browser with no software to install.