Skip to main content

IP Subnet Calculator

Calculate subnet details from any IP/CIDR notation

EVT·T178
CIDR Subnet Math

About the IP Subnet Calculator

The IP Subnet Calculator turns an IP/CIDR pairing into a complete subnet summary: network address, broadcast address, subnet mask (dotted-decimal and binary), wildcard mask (for Cisco ACLs and OSPF), first and last usable host, total addresses, and usable host count. A 32-bit binary breakdown highlights where the network boundary falls inside each octet, and the subnet-divider mode splits a parent network into N equal subnets (or VLSM-style variable-length sub-allocations).

It is built for network engineers planning a fresh LAN allocation, sysadmins computing the broadcast and host range for a firewall rule, CCNA/CCNP students drilling subnetting math, and developers configuring AWS/Azure VPC CIDR blocks that need non-overlapping ranges with on-prem networks.

All calculation runs locally in JavaScript using bitwise operations on the parsed octets. The IP address, prefix, and any custom labels never leave the device — the page makes no network call after first load. Internal network topology is operationally sensitive, so the calculator deliberately keeps everything client-side.

Two non-obvious points to keep front of mind: (1) /31 point-to-point links are valid per RFC 3021 — the legacy advice to use /30 for router-to-router links wastes two addresses per link, which adds up across a large network; modern designs prefer /31 with no broadcast; (2) when allocating RFC 1918 private space (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), pick subnets that cannot collide with cloud VPCs, partner-VPN routes, or future M&A targets — the most common painful migration is renumbering an overlapping 10.0.0.0/16 you assumed was private. IPv6 changes the math: per RFC 4291 every LAN should be /64; subnetting happens at /48 or /56 at the site level.

Privacy100% client-side · no addresses transmitted
StandardsRFC 950 / RFC 1812 / RFC 3021 / RFC 4291
Last reviewed2026-05-14 by Dennis Traina
Subnet
Network Address
Broadcast Address
First Usable Host
Last Usable Host
Total Addresses
Usable Hosts
Subnet Mask
Wildcard Mask
CIDR Notation
IP Class
32-Bit Binary Representation
Network bits Host bits
Quick reference: A /24 gives 256 addresses (254 usable). Each step down in prefix length doubles the addresses — /23 = 512, /22 = 1024. Each step up halves them — /25 = 128, /26 = 64.
2

Specify the number of hosts needed per subnet. Subnets are allocated largest-first for optimal addressing.

Enter multiple subnets (one per line) to find the smallest summarized route that covers them all.

VLSM calculator, supernetting, IPv6 & save history require subscription
Save requires subscription
Honey-Do Tracker — home maintenance for landlords and property managers

How IP Subnetting Works (Visual Guide)

Every IPv4 address is a 32-bit number split into four 8-bit octets, written in dotted-decimal notation like 192.168.1.0. Subnetting divides that 32-bit space into two parts: network bits on the left identify the network, and host bits on the right identify individual devices. The subnet mask tells routers where the boundary falls. When a router receives a packet, it performs a bitwise AND between the destination IP and the subnet mask to extract the network address, then consults its routing table to decide where to forward the packet. The number of host bits determines how many devices the subnet can accommodate — with n host bits you get 2n total addresses, minus two reserved for the network address (all host bits zero) and the broadcast address (all host bits one). Subnetting lets administrators carve a large address block into smaller, manageable segments, improving security by isolating broadcast domains and simplifying routing through address summarisation.

CIDR Notation Explained with Examples

Classless Inter-Domain Routing replaced the rigid Class A / B / C system in 1993 with a flexible prefix-length notation. Instead of saying a network uses a 255.255.255.0 mask, you append /24 to the IP address. The number after the slash is the prefix length — the count of contiguous 1-bits in the mask, starting from the most significant bit. A /24 network has 24 network bits and 8 host bits, supporting 256 total addresses (254 usable). A /16 has 16 network bits and 16 host bits — 65,536 addresses. A /32 is a single host address with no host bits at all, commonly used in routing tables and access control lists. CIDR enabled variable-length subnet masking, letting network engineers allocate blocks of precisely the size they need rather than wasting addresses on oversized class boundaries. It also enabled supernetting — aggregating contiguous smaller blocks into a single larger prefix for cleaner routing tables.

Subnet Mask Quick Reference Table

The relationship between prefix length, subnet mask, available addresses and usable hosts follows a simple pattern of powers of two. At /32, the mask is 255.255.255.255 and there is exactly one address — a single host. At /31 (255.255.255.254), there are two addresses with no usable hosts under the traditional model, though RFC 3021 allows point-to-point links. Moving left, /30 (255.255.255.252) provides four addresses and two usable hosts, while /29 (255.255.255.248) gives eight addresses and six hosts. A /28 (255.255.255.240) yields 16 addresses and 14 hosts, often used for small server segments. The popular /24 (255.255.255.0) provides 256 addresses and 254 usable hosts, the sweet spot for most local area networks. At /16 (255.255.0.0) you get 65,536 addresses, and /8 (255.0.0.0) provides over 16 million — historically allocated as Class A blocks to large organisations. Each step in prefix length either doubles or halves the available address space, making mental arithmetic straightforward once you internalise the pattern.

How to Divide a Network into Subnets

Network segmentation starts with identifying how many subnets you need and how many hosts each requires. To create n equal subnets from a parent block, find the smallest power of two greater than or equal to n and borrow that many bits from the host portion. Splitting a /24 into four subnets borrows two bits (22 = 4), producing four /26 subnets with 64 addresses each (62 usable). For eight subnets, borrow three bits to get /27 blocks with 32 addresses (30 usable). When subnets need different sizes — a server farm with 100 hosts alongside several point-to-point links — you use Variable Length Subnet Masking (VLSM). VLSM allocates the largest subnet first, then subdivides the remaining space for progressively smaller requirements. This avoids the waste inherent in equal-size division and is standard practice in modern network design using OSPF or EIGRP, which carry prefix-length information in their routing updates.

Public vs Private IP Address Ranges

RFC 1918 designates three IPv4 ranges for private use behind NAT gateways: 10.0.0.0/8 (16,777,216 addresses), 172.16.0.0/12 (1,048,576 addresses), and 192.168.0.0/16 (65,536 addresses). These addresses are not routable on the public internet, so any number of organisations can reuse them internally without conflict. Public addresses are assigned by Regional Internet Registries (ARIN, RIPE NCC, APNIC, LACNIC, AFRINIC) and are globally unique and routable. Other reserved ranges include 127.0.0.0/8 for loopback, 169.254.0.0/16 for link-local auto-configuration (APIPA), 100.64.0.0/10 for carrier- grade NAT, and 224.0.0.0/4 for multicast. Understanding which ranges are private helps network engineers design addressing schemes that will never collide with public infrastructure, and knowing the reserved blocks prevents accidentally assigning addresses that routers will refuse to forward.

Looking for related tools? Try our Dev & Tech tools for more networking and developer utilities.

Frequently Asked Questions

How many hosts are in a /24 subnet?

A /24 has 8 host bits, giving 2^8 = 256 total addresses. Subtracting the network address and broadcast address leaves 254 usable hosts. The same math works for any prefix: 2^(32 - prefix) total, minus 2 usable.

What is the difference between a /30 and a /31?

A /30 provides 4 addresses with 2 usable for hosts, historically the default for point-to-point router links. RFC 3021 later defined /31 subnets as valid for point-to-point links, giving 2 addresses and no broadcast, which is now the modern preference for saving address space.

Why are the first and last addresses unusable?

The first address (all host bits zero) identifies the network itself in routing tables, and the last (all host bits one) is the directed broadcast address used to reach every host in the subnet. Assigning either to a device would cause routing ambiguity.

What private IP ranges can I use for internal networks?

RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for private use. RFC 6598 additionally allocates 100.64.0.0/10 as shared address space for carrier-grade NAT. None of these should ever route on the public internet.

How does IPv6 subnetting compare to IPv4?

IPv6 uses 128-bit addresses, and per RFC 4291 the standard allocation for a single LAN is /64. This gives 2^64 host identifiers, a number so large that stateless autoconfiguration (SLAAC) can assign unique addresses without tracking. Subnetting is generally done at /48 for sites and /64 for networks.

137 Foundry — custom app building studio
Honey-Do Tracker — home maintenance for landlords and property managers
Honey-Do Tracker — home maintenance for landlords and property managers
Link copied to clipboard!