IP Subnet Calculator

Whether you're a network engineer carving up a corporate LAN or a student trying to make sense of IP addressing for the first time, subnetting can feel like a lot to keep straight. Subnet masks, CIDR notation, wildcard masks, broadcast addresses — the terminology alone is enough to slow anyone down. An IP subnet calculator takes that manual math off your plate. Punch in an IP address and a prefix length, and you get back everything you need: the network address, broadcast address, usable host range, and more. This guide explains the concepts behind those numbers so you actually understand what the calculator is telling you.

Enter Details

/(0–32)

Result

Enter an IPv4 address and CIDR prefix, then calculate.

For planning and education only. Verify production network settings with your administrator.

What Is an IP Subnet Calculator

An IP subnet calculator is a tool that figures out the key properties of a subnet when you give it an IP address and a subnet mask (or CIDR prefix). Instead of doing bitwise AND operations by hand, you let the calculator handle the binary math and hand you back clean, readable results.

Typical outputs include the network address, broadcast address, first and last usable host IPs, total host count, and the wildcard mask. Some calculators also show you the binary representation of the address, which is genuinely useful when you're learning how the math actually works.

Beyond convenience, these tools help you plan IP address allocation without wasting address space. Assigning a /24 network to a department that only needs 10 hosts, for example, burns 244 usable addresses. A subnet calculator helps you right-size those allocations before you configure anything.

How IP Subnetting Works

Subnetting is the practice of dividing a larger IP network into smaller, more manageable pieces called subnets. Each subnet is its own logical network segment, and devices on different subnets need a router to talk to each other.

At a technical level, subnetting works by borrowing bits from the host portion of an IP address and reassigning them to the network portion. The more bits you borrow, the more subnets you can create, but each one has fewer available host addresses.

Here's the basic relationship to keep in mind:

  • A 32-bit IPv4 address is split into a network part and a host part.
  • The subnet mask tells devices which bits belong to the network and which belong to the host.
  • Borrowing 1 host bit gives you 2 subnets. Borrowing 2 bits gives you 4. Each additional bit doubles the subnet count and halves the host count per subnet.

The formula for usable hosts per subnet is 2n - 2, where n is the number of host bits remaining. You subtract 2 because the first address is reserved for the network and the last for broadcast.

IPv4 vs IPv6 Subnetting Explained

IPv4 and IPv6 both support subnetting, but they work a bit differently in practice.

FeatureIPv4IPv6
Address length32 bits128 bits
FormatDotted decimal (e.g., 192.168.1.0)Colon-separated hex (e.g., 2001:db8::1)
Total addresses~4.3 billion~340 undecillion
Typical subnet prefix/8 to /30/48 to /64 for most deployments
Broadcast addressYesNo (uses multicast instead)

With IPv4, address scarcity is real. Network administrators spend a lot of time optimizing allocations to avoid waste. IPv6 flips that entirely. The address space is so large that a standard /64 subnet still gives you 18 quintillion host addresses, so conservation is rarely the concern. Instead, IPv6 subnetting focuses on hierarchy and routing efficiency.

For IPv6, the most common approach is to receive a /48 block from an ISP, then use the next 16 bits to create up to 65,536 internal /64 subnets. It's a much cleaner model once you get used to the scale.

CIDR Notation Explained

CIDR stands for Classless Inter-Domain Routing. Before CIDR came along in 1993, IP addresses were divided into fixed classes (A, B, and C) with rigid subnet sizes. That system wasted huge chunks of address space, and the internet was running out fast.

CIDR fixed that by letting networks be any size, not just the class boundaries. The notation is simple: an IP address followed by a forward slash and a number, like 192.168.10.0/24. The number after the slash tells you how many bits are in the network portion of the address.

  • /8 means the first 8 bits are the network portion (16,777,214 usable hosts)
  • /16 means 16 bits are network (65,534 usable hosts)
  • /24 means 24 bits are network (254 usable hosts)
  • /30 means 30 bits are network (2 usable hosts, common for point-to-point links)

The shorter the prefix, the larger the network. The longer the prefix, the smaller and more specific the subnet. CIDR also allows route summarization, where multiple smaller routes can be advertised as a single larger one, which keeps routing tables lean.

Subnet Mask and Wildcard Mask

A subnet mask is a 32-bit number that works alongside an IP address to identify the network and host portions. It's written in the same dotted-decimal format as an IP address. In a subnet mask, all the network bits are set to 1 and all the host bits are set to 0.

So a /24 subnet mask looks like this in binary:

11111111.11111111.11111111.00000000

Which translates to 255.255.255.0 in dotted decimal. When a device performs a bitwise AND between its IP address and the subnet mask, it gets the network address.

A wildcard mask is basically the inverse of the subnet mask. Flip every bit and you have it. Where the subnet mask has 1s, the wildcard mask has 0s, and vice versa. For a /24 network, the wildcard mask is 0.0.0.255.

Wildcard masks show up most often in access control lists (ACLs) and routing protocols like OSPF. They tell the router which bits to match and which to ignore. A 0 in the wildcard means

Network Address and Broadcast Address

Every subnet has two reserved addresses that can't be assigned to hosts: the network address and the broadcast address. They bookend the subnet.

The network address is the very first address in the subnet, with all host bits set to 0. It identifies the subnet itself and is used in routing tables. You'll see it written as something like 192.168.1.0/24. No device gets this address.

The broadcast address is the last address in the subnet, with all host bits set to 1. A packet sent to this address is delivered to every device on that subnet. For the 192.168.1.0/24 network, the broadcast address is 192.168.1.255.

Everything in between those two is fair game for host assignment. That's why the usable host count is always the total address count minus 2.

Usable Host Range Calculation

Once you know the network address and broadcast address, the usable host range is just the addresses in between. Simple in concept, but the formula makes it concrete.

For any subnet with a prefix length of n bits:

  • Total addresses = 2(32-n)
  • Usable hosts = 2(32-n) - 2
  • First usable host = network address + 1
  • Last usable host = broadcast address - 1

Take a 192.168.5.0/26 as an example. The prefix is 26, so there are 6 host bits. That gives 26 = 64 total addresses and 62 usable hosts. The network address is 192.168.5.0, the broadcast is 192.168.5.63, and the usable range runs from 192.168.5.1 to 192.168.5.62.

Very small subnets like /31 and /32 are special cases. A /31 has only 2 addresses and no traditional broadcast, making it useful for point-to-point links (RFC 3021). A /32 is a host route, representing a single IP address with no subnet at all.

Subnet Examples and Common CIDR Values

Seeing real numbers side by side makes the relationships between prefix lengths, subnet masks, and host counts much easier to internalize.

CIDRSubnet MaskTotal AddressesUsable HostsCommon Use
/8255.0.0.016,777,21616,777,214Large ISP or enterprise blocks
/16255.255.0.065,53665,534Campus or regional networks
/24255.255.255.0256254Standard office or home LAN
/25255.255.255.128128126Split a /24 into two halves
/26255.255.255.1926462Small department or VLAN
/27255.255.255.2243230Small workgroup
/28255.255.255.2401614Very small segment
/30255.255.255.25242Point-to-point WAN links
/32255.255.255.25510Host route (loopback, ACL)

The /24 is by far the most common in everyday networking. It's easy to remember, gives you 254 hosts, and maps cleanly to the third octet of an address. When you need to break things down further, /25 and /26 are the next natural steps.

For point-to-point connections between two routers, /30 is the classic choice since you only need 2 usable addresses. Some engineers now use /31 to squeeze out a tiny bit more efficiency, which works fine on modern equipment that supports RFC 3021.

Other Technology Calculators

Explore all