Calculators4All
Home / Other Blog / Subnet calculator
Other calculator

Subnet calculator

Calculate the network address, broadcast address, and usable host range for an IPv4 address and subnet mask.

—
Network address
Subnet mask—
Broadcast address—
Usable host range—
Total usable hosts—
Wildcard mask—

What CIDR notation means

A CIDR prefix like /24 tells you how many of the 32 bits in an IPv4 address are fixed as the network portion — the rest identify individual hosts within that network. A /24 fixes the first 24 bits (the first three octets), leaving 8 bits for host addresses, which is why /24 is the common "255.255.255.0" home and small-office network size.

Network, broadcast, and usable hosts

Within any subnet, the very first address is reserved as the network address (identifying the subnet itself) and the very last is reserved as the broadcast address (used to reach every device on that subnet at once). Every address between those two endpoints is usable for an actual device — which is why usable hosts is always 2 less than the total addresses in the block.

Common subnet sizes

CIDRSubnet maskUsable hosts
/24255.255.255.0254
/25255.255.255.128126
/28255.255.255.24014
/30255.255.255.2522

This calculator covers standard IPv4 subnetting and doesn't account for special-purpose ranges or IPv6.

How to use this subnet calculator

Enter an IPv4 address and its CIDR prefix (like 192.168.1.0/24), or enter the address alongside a dotted-decimal subnet mask (like 255.255.255.0) — both represent the same information in different formats. Click Calculate, and the tool returns the network address, broadcast address, the range of usable host addresses, and the total number of usable hosts within that subnet. This is commonly used when configuring routers, setting static IP addresses, or planning how to divide a larger network into smaller segments.

Why networks are divided into subnets

Subnetting breaks a larger network into smaller, more manageable segments, which offers several practical benefits. It reduces broadcast traffic, since broadcast messages only need to reach devices within the same subnet rather than an entire large network. It improves security by allowing different subnets to have different access rules, isolating sensitive systems from general traffic. It also makes IP address allocation more efficient — instead of assigning an entire /24 block (254 usable addresses) to a department that only needs 20 devices, subnetting allows a smaller, appropriately sized block to be carved out, leaving the remaining addresses available for other uses.

Understanding subnet masks and binary

An IPv4 address and its subnet mask are both 32-bit numbers, usually written in dotted-decimal notation (four numbers separated by periods, each ranging from 0 to 255). The subnet mask works by marking which bits of the address represent the network portion (typically shown as binary 1s) versus the host portion (binary 0s). A mask of 255.255.255.0 in binary is 11111111.11111111.11111111.00000000 — the first 24 bits are 1s (network) and the last 8 are 0s (host), which is exactly what a /24 CIDR prefix represents. Understanding this binary relationship makes it clear why CIDR notation and dotted-decimal masks are just two different ways of expressing the same underlying division.

Why network and broadcast addresses aren't usable for devices

Within every subnet, the first address (all host bits set to 0) is reserved as the network address, which identifies the subnet as a whole rather than any individual device on it. The last address (all host bits set to 1) is reserved as the broadcast address, used to send a message to every device on that subnet simultaneously. Neither of these two addresses can be assigned to an individual device, which is why the number of usable host addresses in any subnet is always exactly 2 less than the total number of addresses in that block — a /24 subnet has 256 total addresses but only 254 usable for actual devices.

Practical subnetting scenarios

Subnetting comes up constantly in real network administration. Home routers typically use a /24 network (254 usable addresses) by default, which is far more than most households need but simplifies configuration. Businesses often subnet by department or floor — separating finance, engineering, and guest WiFi into different subnets for both security and traffic management. Cloud infrastructure providers use subnetting extensively to organize virtual networks, isolating public-facing resources from internal databases and services. Even small office networks benefit from basic subnetting concepts when troubleshooting connectivity issues, since knowing whether two devices are on the same subnet often explains why they can or can't communicate directly.

VLSM and subnetting efficiency

Variable Length Subnet Masking (VLSM) takes subnetting a step further by allowing different subnets within the same network to use different mask sizes, rather than forcing every subnet to be the same size. This means a network administrator can carve out a slash-30 for a point-to-point router link, a slash-28 for a small server room, and a slash-24 for a larger office segment, all from the same overall address block — matching subnet size to actual need rather than wasting addresses on uniformly large allocations.

Frequently asked questions

What's the difference between CIDR notation and a subnet mask? They represent the same information in different formats — CIDR notation (like /24) is a shorthand count of network bits, while a subnet mask (like 255.255.255.0) writes out the same division in dotted-decimal form.

Why can't I assign the network or broadcast address to a device? These two addresses are reserved by networking standards to identify the subnet itself and to enable broadcast messaging — assigning them to a device would create conflicts with these core networking functions.

Does this calculator work for IPv6 addresses? No — this tool is built specifically for IPv4 subnetting. IPv6 uses a much larger address space and different conventions that require separate calculation methods.

What's the smallest usable subnet size? A /30 subnet (4 total addresses, 2 usable) is the smallest practical subnet for connecting two devices directly, such as a link between two routers, since it needs a network address, a broadcast address, and exactly two usable host addresses.

How many usable hosts does a slash-26 subnet have? A slash-26 leaves 6 bits for hosts, giving 64 total addresses and 62 usable hosts after subtracting the network and broadcast addresses.

Can two devices on different subnets communicate directly? Not without a router — devices on different subnets need a router or Layer 3 device to forward traffic between them, since subnets are, by design, separate broadcast domains.

What's the difference between a public and private IP address in subnetting? Private IP ranges (like 192.168.0.0/16 or 10.0.0.0/8) are reserved for internal networks and aren't routable on the public internet, while public IPs are globally unique and reachable — subnetting logic works identically for both.

Last reviewed by Mehmed on July 11, 2026.