Skip to main content

CIDR Subnet Calculator with Host Range + Binary View

Calculate subnet details for IPv4 networks. Enter an IP address and CIDR prefix to get network address, broadcast address, host range, subnet mask, and binary breakdown.

Last updated:
Reviewed by Waqar Kaleem Khan, Founder & Lead AI Engineer
Supports IPv4 addresses with CIDR notation (e.g., 192.168.1.0/24)
Loading calculator...

You add a VLAN for the accounting team, type 10.10.5.0/25 into the switch, and nothing routes. The core router already has 10.10.5.0/24 summarised to a different interface — your /25 sits inside that range and gets swallowed. Silent black hole. A CIDR subnet miscalculation like this only surfaces when someone on the new segment tries to reach the internet.

Enter an IPv4 address and prefix length. The calculator returns network address, broadcast, usable host range, subnet mask, wildcard mask, and a binary breakdown before you commit to a router config or firewall rule.

Why Subnetting Errors Break More Than Routing Tables

A mismatched prefix between two interfaces creates an asymmetric path. Packets leave on one subnet and replies return on another. Pings work. TCP sessions time out. Most teams troubleshoot the application layer first, burning hours before someone checks the mask.

Firewall rules compound the problem. If an ACL references 10.10.5.0/24 but the segment is actually /25, the rule covers addresses belonging to a different VLAN. Traffic leaks. Sometimes it gets dropped with no obvious error. The IANA IPv4 Special-Purpose Address Registry lists reserved ranges you should never assign. Keep it open while you plan.

Network Address, Broadcast, and the Usable Range Between Them

Every subnet reserves two addresses: the network address (all host bits zero) and the broadcast (all host bits one). Everything else is usable. A /24 gives 254 hosts, /26 gives 62, /28 gives 14, /30 gives 2 (just enough for a point-to-point router link). If you need 50 hosts, a /26 technically fits but leaves zero growth room. A /25 with 126 usable addresses is the safer pick.

Wildcard Masks: The Inverse Nobody Memorizes

A wildcard mask flips every bit of the subnet mask. A /24 mask of 255.255.255.0 becomes 0.0.0.255. Cisco ACLs and OSPF area statements use wildcards, so you'll see them constantly if you touch routing or firewalls. The gotcha: wildcard masks can be non-contiguous in ACLs (0.0.0.254 matches every other address) even though subnet masks cannot. Most teams treat wildcards as “just flip the mask.” That works for subnetting. It breaks if you inherit unusual ACL rules.

/31 and /32 Prefixes: Point-to-Point and Host-Route Edge Cases

Standard subnetting loses two addresses per block. On a point-to-point link that wastes half of a /30. RFC 3021 allows /31 subnets: both addresses assignable, no broadcast reserved. Most modern routers support it. If yours doesn't, the interface refuses to come up immediately.

A /32 identifies a single host. BGP anycast announcements use it. So do loopback interfaces for router IDs, and blackhole routes for null-routing attacked IPs. The calculator returns 1 usable host with network and broadcast as the same address.

Instant Breakdown: Reading the Binary Behind the Slash

Take 192.168.10.0/26. In binary the last octet reads 00|000000. The pipe marks the /26 boundary. Left of it is network, right is host. Set host bits to all zeroes for the network address (.0), all ones for broadcast (.63), and everything between (.1 through .62) is your 62-host usable range. Spot that boundary in binary and you can subnet any prefix in your head.

Common Gotchas When Subnetting in Production

  • Supernetting direction. Aggregating two /25s into one /24 is not the reverse of splitting. If the /25s have different next-hops, one path vanishes.
  • DHCP scope vs subnet size. A /26 with 62 usable addresses and a 60-address DHCP pool leaves no room for static gateways or printers.
  • Classful thinking. Treating 172.16.0.0 as a fixed /16 ignores that the mask defines the boundary in CIDR networks, not the first octet.

Oversights that cause after-hours calls: a /24 mask pasted into a /25 interface, forgotten /31 broadcast rules, and overlapping subnets where a new /26 collides with an existing /25's network address.

Related calculators on EverydayBudd's developer utilities hub: the File Transfer Time Calculator for sizing transfers across the networks you're provisioning, and the SLA Uptime Calculator for the reliability math that lives next to network design decisions.

Subnet calculations cover IPv4 CIDR addressing only. They don't replace a professional network design, IPAM system, or routing analysis for production deployment.

Frequently Asked Questions

What's the difference between /24 and a 255.255.255.0 subnet mask?

They're two notations for the same thing. /24 is CIDR (Classless Inter-Domain Routing) and counts how many bits identify the network: 24 in this case. 255.255.255.0 is the dotted-decimal form, which is 24 binary ones followed by 8 zeros. CIDR is what you'll see in modern routing tables, BGP announcements, and most documentation. Dotted-decimal still shows up in older Cisco IOS configurations and Windows Server interfaces. A network engineer should be able to read both fluently and switch between them without converting in their head.

Why do I lose 2 addresses in every subnet?

One address is reserved at the bottom of the range as the network address (all-zeros host portion), used to identify the subnet itself in routing tables. One is reserved at the top as the broadcast address (all-ones host portion), used to send packets to every host on the segment. Two exceptions matter. /31 subnets per RFC 3021 use both addresses for point-to-point links because the broadcast concept doesn't apply on a two-host segment. /32 represents a single host route where the question doesn't arise.

When do I actually need a wildcard mask instead of a subnet mask?

A handful of places. Cisco access control lists use wildcard masks because the syntax developed before CIDR became universal: `permit ip 192.168.1.0 0.0.0.255` matches the /24. OSPF network statements use the same notation when defining which interfaces participate in an area. Some firewall rule languages (older Juniper, certain iptables patterns) also accept wildcards for non-contiguous matching, like matching only odd-numbered addresses in a range. Outside those contexts, subnet masks are what you want.

I need to provision a printer VLAN with growth headroom. What size do I pick?

Print operations grow when departments add devices, so a /27 (30 usable hosts) is the conservative choice for an office under 20 printers today. /28 (14 usable) is tighter and renumbers painfully if you outgrow it. Moving printers between subnets means coordinating IP changes across print servers, GPO settings, and direct-IP queue references. The calculator's Usable Hosts output gives you the realistic ceiling. Don't size by today's count. Size by the count you'll have in three years.

When does the public-vs-private distinction actually break something?

A few common failure modes. Most often: martian routes leak when private addresses get mistakenly redistributed into BGP announcements. Then there's the merger problem, where two acquired networks both run 192.168.0.0/16 and you discover IP collisions during integration testing. NAT hairpinning bites people too, when two segments share the same private space and you need traffic between them to traverse NAT. RFC 1918 allocates 10/8, 172.16/12, and 192.168/16 as private. Anything outside those ranges that isn't in your IGP shouldn't be routed internally. One useful aside: 100.64.0.0/10 (CGNAT space, RFC 6598) is reserved for ISP-side carrier-grade NAT and shouldn't appear in enterprise networks despite looking private-ish.

When does VLSM actually matter in practice?

When a flat /24-everywhere design would burn address space you'll need later. A campus with 200-host office segments, 14-host wiring-closet management VLANs, and 2-host point-to-point WAN links is the canonical VLSM case. Using /24 across all three wastes 90% of the address pool. VLSM also matters for route summarization. Aggregating eight /27s into a /24 reduces routing-table entries upstream, which matters on routers with limited TCAM. For homelab and small office networks under 100 hosts, the savings are theoretical and a flat /24 is fine.

What's a /32 actually used for?

The most common use is loopback interfaces on routers, where /32 gives the device an identity address that stays stable even when physical interfaces flap. Routing protocols use those loopbacks for things like OSPF router-IDs and BGP neighbor relationships. /32s also show up in firewall rules when you need to permit a specific host (and only that host) to reach a destination. VPN endpoints commonly use them. So do BGP next-hop entries where the next hop is a single address rather than a network. The common thread: when routing or filtering needs to talk about exactly one host, /32 is the right prefix length.

I have a /23 and need to split it into smaller segments. How does the math work?

A /23 contains 512 addresses (510 usable), which you can split into two /24s, four /25s, eight /26s, sixteen /27s, or down to /30s for point-to-point links. Each bit you borrow from the host portion doubles the subnet count and halves the host count. The manual approach: write out the third octet in binary, identify which bits become subnet bits at each prefix length, and read off the resulting ranges. Sanity-check at /27. The third octet's last bit and the fourth octet's top three bits combine to give 8 subnets of 32 addresses each within a /23.

What's the difference between the network address and the first usable host?

The network address is the all-zeros host portion (192.168.1.0 in a /24). It identifies the subnet itself and isn't assignable. The first usable host is the network address plus one (192.168.1.1), and that's where most networks place the default gateway, though there's no protocol requirement to do so. Some shops use the last usable address (.254 in a /24) for the gateway instead. Pick a convention and stick to it across the network. Mixed conventions are how on-call engineers find the gateway in an unexpected place at 2 AM.

How do I calculate the network address by hand to verify a tool?

Convert the IP and the subnet mask to binary, AND them bit-by-bit (1 AND 1 = 1, all other combinations = 0), and convert the result back to decimal. For 192.168.1.100 with mask 255.255.255.0: the IP becomes 11000000.10101000.00000001.01100100, the mask becomes 11111111.11111111.11111111.00000000, the AND result is 11000000.10101000.00000001.00000000 = 192.168.1.0. Worth doing on paper once or twice when you're learning, especially for non-octet-aligned masks like /27 where the third or fourth octet doesn't fall on a clean boundary.

What are the RFC 1918 private ranges, and when would I pick one over another?

10.0.0.0/8 (16.7M addresses), 172.16.0.0/12 (1M addresses), and 192.168.0.0/16 (65K addresses). For home networks and small offices, 192.168.0.0/16 is the cultural default because every consumer router ships with 192.168.1.x or 192.168.0.x. For enterprise networks, 10.0.0.0/8 gives the most room and the cleanest hierarchical addressing (10.[region].[site].[host]). 172.16.0.0/12 is the awkward middle child, large enough for medium businesses but visually less obvious as private space, so it shows up in network diagrams less often. None of the three is more secure than another. Security comes from NAT and firewalling, not the address range.

Why does my router show a different broadcast address than this tool calculates?

A few possibilities. The first thing to check is whether you're on a /31 (RFC 3021 point-to-point), because there is no broadcast in that case. Both addresses are usable hosts, and most routers display the link's directed broadcast differently than the standard math suggests. If it isn't a /31, look at whether the router is using directed-broadcast suppression. That's been the security default on modern Cisco IOS images for years. The broadcast address exists, but the router won't forward to it. The other common cause is just a fat-fingered mask: somebody typed /25 instead of /24 in the interface config. The calculator returns the standards-defined broadcast (the all-ones host address), which is correct for /30 and shorter but never matters on /31s.

Explore More Tech & Dev Utilities

Discover our collection of developer utilities, network calculators, and tech tools for building better software.

How helpful was this calculator?