IP Subnet Calculator

IP Subnet Calculator
Networking

IP Subnet Calculator

Enter either a CIDR prefix or a subnet mask. Optionally split the base network into a number of equal-sized subnets (VLSM-style).
Please enter a valid IPv4 address and either a CIDR prefix (0–32) or a valid subnet mask.
Network Address
CIDR
Subnet Mask
Wildcard Mask
Broadcast Address
First Usable Host
Last Usable Host
Usable Hosts
Total Addresses
Disclaimer: This tool performs standard IPv4 subnetting and VLSM-style splitting arithmetic for general reference and educational use. It does not validate reachability, routing, or organizational IP addressing policy. Confirm results against your network documentation before making configuration changes.

IP Subnet Calculator: How to Break Down Any Network in Seconds

Quick answer: An IP subnet calculator converts a network address and CIDR prefix (like 192.168.1.0/24) into the subnet mask, network address, broadcast address, and usable host range, without you having to do binary math by hand. This guide covers the exact formulas, a full CIDR reference table, and worked examples for the subnet sizes IT students and network admins ask about most.

Subnetting is one of those topics that almost every networking student describes as confusing the first time they encounter it, and that reputation is well earned — the math involves binary conversion, and a single misplaced bit changes your entire host range. An IP subnet calculator exists precisely to remove that friction, instantly turning a CIDR notation like /26 into a usable, human-readable breakdown of your network. Below, we’ll walk through exactly how that conversion works so the calculator’s output actually makes sense.

How an IP Subnet Calculator Works

Every IPv4 address is a 32-bit number, split into a network portion and a host portion. The subnet mask (or CIDR prefix) tells you where that split happens. A /24 means the first 24 bits identify the network, leaving 8 bits for host addresses; a /26 means 26 bits for the network and only 6 bits left for hosts.

The Core Subnetting Formulas

Total addresses in a subnet = 2^(host bits)

Usable hosts = 2^(host bits) − 2

The subtraction of 2 accounts for the network address (the first address, which identifies the subnet itself) and the broadcast address (the last address, reserved for broadcasting to every device on that subnet) — neither can be assigned to a device. This “subtract 2” rule is one of the most repeated tips in subnetting cheat sheets and study guides, precisely because it’s the detail beginners forget most often.

CIDR to Subnet Mask Reference Table

CIDRSubnet MaskTotal AddressesUsable Hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

This table mirrors the standard subnetting cheat sheets widely shared in networking and CCNA study communities, which note that the number of hosts doubles with every step down in CIDR prefix length, and that you always subtract 2 from the address total to get usable hosts.

Worked Example #1: Subnetting a /24 Network

Say you’re given the network 192.168.1.0/24 and need four equal subnets for four office departments.

  1. You need 4 subnets, which requires borrowing 2 bits from the host portion (2^2 = 4).
  2. New prefix: /24 + 2 = /26
  3. New subnet mask: 255.255.255.192
  4. Each subnet has 2^6 = 64 total addresses, or 62 usable hosts.

The four resulting subnets are:

  • 192.168.1.0/26 → hosts 192.168.1.1–192.168.1.62, broadcast 192.168.1.63
  • 192.168.1.64/26 → hosts 192.168.1.65–192.168.1.126, broadcast 192.168.1.127
  • 192.168.1.128/26 → hosts 192.168.1.129–192.168.1.190, broadcast 192.168.1.191
  • 192.168.1.192/26 → hosts 192.168.1.193–192.168.1.254, broadcast 192.168.1.255

Worked Example #2: Finding the Network and Broadcast Address

Given the IP address 10.0.5.130 with a /27 mask:

  1. /27 = 255.255.255.224, meaning subnets increment by 32 (256 − 224 = 32).
  2. The subnet boundaries near 130 are 128 and 160, so this address falls in the 10.0.5.128/27 subnet.
  3. Network address: 10.0.5.128
  4. Broadcast address: 10.0.5.159
  5. Usable host range: 10.0.5.129 – 10.0.5.158

Worked Example #3: Point-to-Point Link with a /30

Router-to-router links commonly use a /30 subnet because it provides exactly enough addresses for two devices:

  • Total addresses: 2^2 = 4
  • Usable hosts: 4 − 2 = 2
  • Example: 172.16.10.0/30 → network 172.16.10.0, hosts 172.16.10.1 and 172.16.10.2, broadcast 172.16.10.3

This is why /30 is the default recommendation in most networking courses for WAN links between two routers — it wastes the fewest addresses possible while still following the network/broadcast rule.

Step-by-Step: How to Use an IP Subnet Calculator

  1. Enter the IP address you’re working with (e.g., 192.168.1.0).
  2. Enter the CIDR prefix or subnet mask (e.g., /24 or 255.255.255.0).
  3. Read the output: network address, broadcast address, usable host range, and total number of addresses.
  4. If splitting into multiple subnets, specify how many subnets or hosts per subnet you need, and the calculator will suggest the correct new CIDR prefix (this is often labeled “VLSM” or “subnet splitting” mode).

Common Mistakes People Make

  • Forgetting to subtract 2 for the network and broadcast address, leading to an overestimate of usable hosts.
  • Mixing up subnet mask and wildcard mask — the wildcard mask is the inverse of the subnet mask and is used in access control lists, not for host counting.
  • Assuming class-based defaults still apply (Class A/B/C) when CIDR has made classful boundaries mostly irrelevant outside of legacy documentation.
  • Miscounting borrowed bits when creating VLSM subnets of different sizes for different departments.
  • Confusing IPv4 and IPv6 notation — IPv6 uses a completely different addressing scheme where a /64 is the standard end-user allocation, not remotely comparable to an IPv4 /24.

Frequently Asked Questions

What does CIDR notation actually mean?

CIDR (Classless Inter-Domain Routing) notation expresses how many bits of an IP address are used for the network portion, written as a slash followed by a number, such as /24 for a 24-bit network prefix.

How many usable IP addresses are in a /24 subnet?

A /24 subnet has 256 total addresses, but only 254 are usable for hosts once the network address and broadcast address are excluded.

What’s the difference between a subnet mask and a wildcard mask?

A subnet mask marks which bits belong to the network (1s) versus the host (0s), while a wildcard mask is its bitwise inverse and is primarily used in router access control list configurations.

Why do point-to-point links use a /30 instead of a /24?

A /30 provides exactly two usable addresses, which is all a two-router link needs, so using a larger subnet there would waste dozens of unused IP addresses.

Is subnetting different for IPv6?

Yes — IPv6 subnetting uses 128-bit addresses instead of 32-bit, and a /64 is the standard subnet size for a single network segment rather than the smaller subnets common in IPv4.

Related Calculators

Conclusion

Once you understand that a subnet mask is simply a boundary marker between network bits and host bits, an IP subnet calculator becomes less of a mystery box and more of a shortcut for math you could technically do by hand. Use the reference table and worked examples above to sanity-check the calculator’s output, and remember the golden rule that trips up nearly every beginner: always subtract 2 for the network and broadcast address before reporting usable hosts.