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.

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. A CIDR subnet miscalculation like this creates silent black holes that only surface when someone on the new segment tries to reach the internet.

Enter an IPv4 address and prefix length to get network address, broadcast, usable host range, subnet mask, wildcard mask, and binary breakdown before committing 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 but TCP sessions time out. Most teams troubleshoot the application layer first, burning hours before someone checks the mask.

Firewall rules compound it. If an ACL references 10.10.5.0/24 but the segment is /25, the rule covers addresses belonging to a different VLAN — traffic leaks or 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 in between 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 will 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” which works for subnetting but 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 — two addresses, both assignable, no broadcast. Most modern routers support it; if yours does not the interface refuses to come up immediately.

A /32 identifies a single host — seen in BGP anycast announcements, 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. If you can spot that boundary in binary 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 — not the first octet — defines the boundary in CIDR networks.

Oversights that cause after-hours calls: pasting a /24 mask into a /25 interface, forgetting /31 has no broadcast, and overlapping subnets because the new /26 shares a network address with an existing /25.

Related tools: File Transfer Time Calculator for bandwidth estimates across your planned segments, API Rate Limit Planner for sizing throughput behind these subnets, SLA Uptime Calculator for availability targets, and Password Entropy Estimator for credentials on devices in the new subnet.

Subnet calculations cover IPv4 CIDR addressing only — they do not replace a professional network design, IPAM system, or routing analysis for production deployment.

Frequently Asked Questions

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

They are the same! /24 is CIDR notation meaning 24 bits are used for the network portion. When you convert 24 ones followed by 8 zeros to decimal, you get 255.255.255.0. CIDR notation is more compact and commonly used in modern networking. Understanding CIDR notation helps you see how to specify network boundaries efficiently. Both notations represent the same subnet mask: 24 network bits and 8 host bits, allowing 254 usable host addresses (256 total - 2 reserved).

Why do I lose 2 addresses in a subnet?

In most subnets, the first address is reserved as the Network Address (identifies the subnet itself) and the last address is the Broadcast Address (used to send data to all hosts). These cannot be assigned to individual hosts. Exception: /31 subnets (RFC 3021) allow both addresses for point-to-point links (both addresses usable for router-to-router connections), and /32 subnets represent single host routes (only one address exists). Understanding address reservation helps you see why usable host count is typically TotalHosts - 2.

What is a wildcard mask and when is it used?

A wildcard mask is the inverse of a subnet mask. Where a subnet mask has 1s, the wildcard has 0s, and vice versa. Wildcard masks are commonly used in Cisco access control lists (ACLs) to match IP address ranges (specify which bits to match, which to ignore), OSPF configurations to define network statements (OSPF uses wildcard masks for network matching), and firewall rules to match address ranges. For example, subnet mask 255.255.255.0 has wildcard mask 0.0.0.255. Understanding wildcard masks helps you see how to match IP address ranges in network configurations.

How do I choose the right subnet size?

Consider the number of hosts you need now plus room for growth (plan for at least 20–30% growth to accommodate future expansion). If you need 50 hosts, a /26 (62 usable hosts) might work, but a /25 (126 usable hosts) gives more room to grow. Always plan for at least 20–30% growth and remember you lose 2 addresses per subnet (network and broadcast addresses). Consider network segmentation needs (smaller subnets for better security and performance), routing requirements (route summarization, routing table size), and future expansion (growth planning, address space allocation). Understanding subnet sizing helps you choose appropriate CIDR prefixes for your network design requirements.

What is the difference between public and private IP addresses?

Private IP addresses (10.x.x.x, 172.16–31.x.x, 192.168.x.x per RFC 1918) are used within internal networks and cannot be routed on the public internet (not globally unique, not routable on internet). Public IP addresses are globally unique and routable on the internet (assigned by ISPs, globally unique, routable on internet). Private addresses require NAT (Network Address Translation) to communicate with the internet (translates private IPs to public IPs for internet access). Understanding public vs private addresses helps you see why private addresses are used for internal networks and how NAT enables internet access.

What does VLSM mean and why is it important?

VLSM (Variable Length Subnet Masking) allows you to use different subnet sizes within the same network. Instead of using the same /24 everywhere, you might use /30 for router links (2 hosts for point-to-point connections), /24 for office LANs (254 hosts for large networks), and /26 for smaller departments (62 hosts for medium networks). This maximizes IP address efficiency (reduces wasted address space, optimizes address allocation) and enables flexible network design (different subnet sizes for different needs). Understanding VLSM helps you see how to optimize IP address allocation and design efficient network hierarchies.

What is a /32 subnet used for?

A /32 represents a single host address (host route). It's commonly used in routing tables to specify a route to exactly one IP address (host-specific routing, precise routing control), in firewall rules to match a specific host (exact host matching, security rules), or in loopback interfaces on routers (router loopback addresses, management interfaces). /32 subnets are also used for VPN endpoints, server-specific routes, and network management interfaces. Understanding /32 subnets helps you see how to configure host-specific routing and security rules.

How do I subnet a network into smaller pieces?

To divide a network, borrow bits from the host portion. For example, a /24 network can be split into two /25 networks (128 addresses each, 126 usable hosts each), four /26 networks (64 addresses each, 62 usable hosts each), or eight /27 networks (32 addresses each, 30 usable hosts each). Each additional bit borrowed doubles the number of subnets while halving the hosts per subnet (1 bit = 2 subnets, 2 bits = 4 subnets, 3 bits = 8 subnets). Understanding subnet division helps you see how to create subnet hierarchies and allocate address space efficiently.

What is the difference between network address and first usable host?

The network address is the first address in a subnet and identifies the network itself (cannot be assigned to hosts, used for routing). The first usable host is the network address + 1 (can be assigned to hosts, first assignable address). For example, in 192.168.1.0/24: network address is 192.168.1.0 (cannot be assigned), first usable host is 192.168.1.1 (can be assigned). Exception: /31 subnets (RFC 3021) allow both addresses for point-to-point links, and /32 subnets represent single host routes. Understanding this distinction helps you see why network address cannot be assigned and how to identify assignable addresses.

How do I calculate the network address manually?

To calculate network address manually: convert IP address and subnet mask to binary (each octet to 8-bit binary), perform bitwise AND operation between IP address and subnet mask (1 AND 1 = 1, all other combinations = 0), convert result back to dotted decimal notation. For example, 192.168.1.100 AND 255.255.255.0: 192.168.1.100 (binary: 11000000.10101000.00000001.01100100) AND 255.255.255.0 (binary: 11111111.11111111.11111111.00000000) = 192.168.1.0 (binary: 11000000.10101000.00000001.00000000). Understanding manual calculation helps you verify tool results and understand subnetting fundamentals.

What are the private IP address ranges (RFC 1918)?

Private IP address ranges per RFC 1918 are: Class A: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255, 16,777,216 addresses), Class B: 172.16.0.0/12 (172.16.0.0 to 172.31.255.255, 1,048,576 addresses), Class C: 192.168.0.0/16 (192.168.0.0 to 192.168.255.255, 65,536 addresses). These ranges are reserved for private networks and are not routable on the public internet. Understanding private IP ranges helps you see why these addresses are used for internal networks and how they enable network address translation (NAT) for internet access.

What factors affect subnet calculation that this tool doesn't account for?

This tool does not account for many factors that affect real-world network design: routing requirements (routing protocols, route summarization, routing table size affect network design), security requirements (firewall rules, access control lists, network segmentation affect subnet boundaries), growth planning (future expansion, address space allocation, subnet hierarchy affect subnet sizing), IPv6 considerations (IPv6 addressing, dual-stack configurations affect network design), reserved addresses within subnets (gateway addresses, server addresses, management addresses may be reserved), and many other factors. Real network design accounts for these factors using detailed network engineering, routing analysis, security planning, and comprehensive network design. Understanding these factors helps you see why professional network design is necessary for comprehensive network systems.

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?

CIDR Subnet Calculator: Network, Hosts, Broadcast