Skip to content
Calixo

IP Subnet Calculator

Find the number of usable hosts and total addresses for a given CIDR prefix — a quick reference for the relationship between subnet size and host capacity.

Inputs

Paste this into any page — the widget stays live and updates automatically as this calculator improves. Using WordPress or Notion? See the embed guide.

Saved Scenarios

— select 2+ to compare
Inputs updated · Results recalculated · Just now

Usable Hosts

254

Total Addresses

256

Spark says

How it's calculated
Closeup of switch in server with connectors and adapters connected to plastic device in dark room on blurred background inside
Photo by Brett Sayles on Pexels
System with various wires managing access to centralized resource of server in data center
Photo by Brett Sayles on Pexels

Formula

Usable Hosts=2Host Bits2Usable\ Hosts = 2^{Host\ Bits} - 2
Host\ Bits
— 32 minus the CIDR prefix length

What is the IP Subnet Calculator?

A CIDR prefix (e.g. /24) determines how many bits of an IPv4 address are reserved for the network vs. host portion — this calculator converts a prefix into the resulting subnet's total and usable address counts.

Use this when choosing the right subnet size for a planned network segment based on expected device count, quickly recalling how many hosts a specific CIDR prefix supports without manual binary math, or explaining subnet sizing to someone learning networking fundamentals.

How to use it

  1. 1 Choose the CIDR prefix (or equivalent subnet mask) you're working with.

Understanding IP Subnet Calculator

Choosing the right subnet size for a network segment is a genuinely practical engineering decision that balances two competing concerns: waste (allocating far more addresses than a segment will ever use) against inflexibility (allocating so few addresses that the segment quickly runs out of room and needs disruptive re-subnetting). Understanding the doubling relationship between CIDR prefix length and address count is the key to making this tradeoff deliberately rather than by guesswork.

Each single-step decrease in prefix length doubles the number of addresses available, because each additional host bit doubles the number of representable combinations — a /24 (8 host bits) provides 256 total addresses, a /23 (9 host bits) provides 512, a /22 (10 host bits) provides 1,024, and so on. This clean doubling pattern makes it straightforward to reason about subnet sizing choices: if a planned network segment needs room for, say, 100 devices with reasonable growth headroom, a /24 (254 usable hosts after the standard two-address reservation) comfortably covers that need with room to spare, while a /25 (126 usable hosts) would be cutting it closer and risk requiring a disruptive resize if the segment grows faster than expected.

The 'why leave room for growth' consideration is worth taking seriously, because re-subnetting an already-deployed, in-use network is genuinely disruptive in a way that over-provisioning slightly at the outset avoids. Every device on the segment potentially needs its IP configuration updated, static routes and firewall rules referencing the old subnet boundaries need updating, and DHCP scopes need reconfiguring — all while trying to avoid downtime for whatever the network segment supports. This asymmetry (mild waste from over-provisioning versus genuine operational pain from under-provisioning) is exactly why experienced network engineers tend to size subnets with meaningful headroom above current need rather than the tightest possible fit, even though the tightest fit would technically waste fewer addresses.

A specific, more advanced subnetting decision worth knowing about involves point-to-point links — connections between exactly two routers, where by definition only two devices will ever need addresses on that segment. The standard convention would suggest a /30 (4 total addresses, 2 usable after network/broadcast reservation) as the smallest practical standard subnet, but RFC 3021 defines a special convention for /31 subnets specifically for point-to-point links, where both addresses in the tiny 2-address range are usable as host addresses (no separate network or broadcast address reserved), since a two-device link has no need for a broadcast address in the traditional sense. This is a genuinely more address-efficient choice for point-to-point links specifically, illustrating that subnet sizing conventions aren't purely mechanical — they can be tailored to the specific topology being addressed, once the underlying prefix-length-to-host-count relationship is well understood.

Worked examples

Advantages

  • Instant lookup of usable host count for any common CIDR prefix, without manual binary arithmetic.
  • Covers the full practical range of common subnet sizes used in real network design.
  • Useful both as a quick professional reference and as a learning tool for subnetting fundamentals.
  • Shows both total addresses and usable hosts, clarifying the standard two-address reservation.

Limitations

  • Subtracts 2 addresses for the network and broadcast address, the standard convention for /24 through /30. Point-to-point /31 and single-host /32 subnets use special conventions not covered here.

Common mistakes

  • ⚠️ Choosing a subnet size based only on current device count, without leaving room for reasonable future growth, leading to needing to re-subnet or renumber a network sooner than expected.
  • ⚠️ Forgetting that usable hosts is always 2 less than the subnet's raw total address count, due to the reserved network and broadcast addresses.
  • ⚠️ Confusing the CIDR prefix length with the number of host bits — the two are complementary (they always sum to 32 for IPv4) but represent opposite things, an easy mix-up when reading network documentation.

Tips

  • 💡 Plan subnet size with headroom for growth, not just current device count — re-subnetting an already-deployed network is disruptive, so erring toward a slightly larger subnet than currently needed is usually the pragmatic choice.
  • 💡 Remember the doubling pattern: each one-step decrease in CIDR prefix length doubles the number of available addresses, useful for quick mental estimation without needing an exact calculation.
  • 💡 For point-to-point links between two routers, consider whether a /31 (using RFC 3021's special two-host convention, no separate network/broadcast reservation) might be more efficient than a standard /30.
  • 💡 When documenting network design, always specify prefix length explicitly rather than relying on assumed defaults, since the same third IP octet range can represent very different subnet sizes depending on the prefix.

Real-life uses

  • Choosing the right subnet size for a planned network segment based on expected device count
  • Quickly recalling how many hosts a specific CIDR prefix supports
  • Explaining subnet sizing fundamentals to someone learning networking
  • Planning IP address allocation across multiple departments or locations

Frequently asked questions

Why subtract 2 from the total address count?

The first address in a subnet is reserved as the network address and the last as the broadcast address — neither can be assigned to a host.

How much does address capacity change with each step in prefix length?

Each one-step decrease in CIDR prefix length doubles the number of available addresses, since each additional host bit doubles the number of representable combinations.

Why plan a subnet larger than current device count requires?

Re-subnetting an already-deployed network is genuinely disruptive — every device's configuration, routing rules, and DHCP scopes may need updating — so building in growth headroom at the outset avoids that operational pain later.

What's special about /31 subnets?

RFC 3021 defines a special convention allowing both addresses in a /31 to be used as host addresses, without the standard network/broadcast reservation — specifically designed for point-to-point links between exactly two routers, where a traditional broadcast address serves no purpose.

How do I choose the right subnet size for a new network segment?

Estimate current device count, add reasonable growth headroom, then choose the smallest CIDR prefix that comfortably covers that total — erring slightly larger avoids the operational disruption of re-subnetting later.