IPv4 Subnet Calculator
How to use this IPv4 subnet calculator
- Type a network in CIDR notation (e.g. 192.168.1.0/24).
- See the network address, broadcast, subnet mask, and usable host range instantly.
- Use this to plan IP allocation or troubleshoot routing.
What does the /24 mean?
The number after the slash is the prefix length — how many bits of the 32-bit IPv4 address are fixed as the network portion. A /24 fixes the first 24 bits, leaving 8 bits (256 addresses) for hosts, of which 254 are usable.
Why are only 254 addresses usable in a /24, not 256?
The first address in the range is reserved as the network address, and the last is reserved as the broadcast address — neither can be assigned to a device.
What's a /31 or /32 used for?
A /31 is commonly used for point-to-point links (2 addresses, no network/broadcast reserved per RFC 3021), and a /32 represents a single host address.
Why subnetting exists — the actual engineering reason
Subnetting isn't just an administrative convention — it solves two real technical problems at internet scale. First, it limits the size of a broadcast domain: every device on the same subnet receives certain broadcast traffic, and a network with too many devices in one broadcast domain wastes bandwidth and processing time on traffic most devices don't need. Second, and just as important historically, subnetting enables route aggregation: an internet router can represent thousands of individual addresses behind one routing table entry for a subnet, rather than needing a separate entry for every single address, which is what makes internet-scale routing tables manageable at all rather than growing to an unworkable size.
How the subnet mask math actually works
Under the hood, a subnet mask and an IP address are just two 32-bit binary numbers, and the network address is computed by a bitwise AND operation between them — for each bit position, the result is 1 only if both the IP address and the mask have a 1 there. A /24 mask (255.255.255.0) is 24 ones followed by 8 zeros in binary, so ANDing it with any address in that subnet zeroes out the last 8 bits, always producing the same network address regardless of which specific host address within that range you started with. The broadcast address is computed similarly, but with the host bits all set to 1 instead of 0 — this bitwise arithmetic is the actual mechanism behind everything this calculator displays, not just a lookup table of common values.
VLSM — why not every subnet in a network needs to be the same size
Variable Length Subnet Masking (VLSM) is the practice of using different prefix lengths for different subnets within the same larger network, based on how many hosts each specific subnet actually needs, rather than carving up an address space into equal-sized chunks regardless of actual usage. A department needing 200 hosts might get a /24 (254 usable addresses), while a point-to-point link between two routers, needing only 2 addresses, gets a /30 or /31 instead of wastefully allocating an entire /24 to a link that will only ever use two addresses. This kind of size-matched allocation is standard professional practice specifically because IPv4 address space is limited enough that wasting it on oversized subnets for small links adds up quickly across a large network.
Common subnetting mistakes
The most frequent subnetting error is planning host counts without accounting for the reserved network and broadcast addresses, leading to allocating a subnet that's exactly one or two addresses too small for what's actually needed — a /26 provides 62 usable addresses, not 64, which matters if you calculated needing exactly 64 hosts. Overlapping subnets are another common mistake in larger networks, where two subnets accidentally share address ranges due to a planning error, causing routing conflicts that can be genuinely difficult to diagnose after the fact. Careful, deliberate subnet planning before deployment — checking usable host counts and range boundaries explicitly rather than assuming round numbers — avoids both of these categories of mistake.
Limitations of this tool
This calculator parses IPv4 CIDR notation and computes network address, broadcast address, subnet mask, and usable host range through straightforward binary arithmetic — it doesn't validate that a subnet is actually reachable or correctly routed on any real network, doesn't check for overlaps against other subnets you might already have allocated elsewhere in your infrastructure, and doesn't handle IPv6 addressing at all, which uses a related but different addressing scheme. Use it to quickly compute the math for a given CIDR block, and cross-check against your actual network documentation and routing configuration before deploying any subnet plan in production.