IP / CIDR Subnet Calculator

Enter any IPv4 CIDR block — like 192.168.1.0/24 — and instantly see the full subnet breakdown.

By Pankaj Kumar · DevToolsHub · Last updated Jun 2026

The bit math behind /24, /30, and every other prefix length

The number after the slash is how many of the 32 bits are fixed as the network portion — the rest are host bits, free to vary across every address in that subnet. Total addresses in the block is 2 raised to the number of host bits; usable host addresses is normally that total minus 2, since the all-zeros address is reserved as the network address and the all-ones address is reserved for broadcast. Worked out for the prefixes you'll actually see day to day:

  • /24 — 8 host bits → 28 = 256 total addresses → 254 usable. The default for a typical office or small cloud subnet.
  • /16 — 16 host bits → 216 = 65,536 total addresses → 65,534 usable. A common size for an entire VPC.
  • /30 — 2 host bits → 4 total addresses → 2 usable. The classic size for a router-to-router link before RFC 3021 made /31 viable for that purpose (see below).

Why this tool still shows a Class A/B/C label nobody routes by anymore

The IP Class field in the results comes from the original 1981 classful addressing scheme — Class A covers 0.x.x.x127.x.x.x, Class B 128.x.x.x191.x.x.x, Class C 192.x.x.x223.x.x.x, with D reserved for multicast and E reserved for experimental use. CIDR replaced classful addressing in 1993 specifically because fixed class boundaries wasted address space — a single host past 254 meant jumping to a whole Class B block. No router has made forwarding decisions based on address class in decades; CIDR prefixes do that job now. The class label here is purely informational, useful for recognizing legacy documentation or exam material that still references it, not for anything an actual subnet design decision should depend on.

Wildcard masks: the inverted view used in ACLs and OSPF

The subnet mask and wildcard mask are bitwise inverses of each other — everywhere the subnet mask has a 1, the wildcard mask has a 0, and vice versa. A /24's subnet mask is 255.255.255.0; its wildcard mask is 0.0.0.255. Cisco IOS access-control lists and OSPF network statements use the wildcard form instead of the subnet-mask form, which trips people up the first time they hand-write an ACL: access-list 10 permit 192.168.1.0 0.0.0.255 matches the same 192.168.1.0/24 block as the subnet-mask notation, just expressed as "which bits don't matter" instead of "which bits must match." Getting the two forms swapped is a classic source of an ACL that silently matches the wrong range instead of throwing a configuration error.

A real edge case: /31 networks

Normally the first address in a subnet is the network address and the last is the broadcast address, leaving the rest usable. /31 is a deliberate exception (RFC 3021): with only 2 addresses total, this calculator treats both as usable host addresses rather than reserving either as network/broadcast. We traced this directly in the calculation logic — it's specifically there for point-to-point links (router-to-router WAN links) where wasting 2 of your only 2 addresses on network/broadcast would leave nothing usable. /32 is handled as a single usable host (used for loopback addresses and host routes).

Private and shared address ranges worth knowing

  • 10.0.0.0/8 — RFC 1918 private (Class A range)
  • 172.16.0.0/12 — RFC 1918 private (Class B range)
  • 192.168.0.0/16 — RFC 1918 private (Class C range)
  • 100.64.0.0/10 — RFC 6598 "shared address space," reserved separately from RFC 1918 for carrier-grade NAT between an ISP and its customers. Easy to mistake for a public range since it falls outside the three classic private blocks — it isn't routable on the public internet either.

Cloud VPC subnetting adds one more wrinkle on top of the standard math above: AWS, Azure, and GCP all reserve additional addresses beyond the usual network/broadcast pair within every subnet they hand you — AWS reserves 5 addresses per subnet (network, broadcast, the VPC router, the DNS server, and one held for future use), not the 2 this calculator's host-count math assumes. A /24 subnet here shows 254 usable hosts; the same /24 as an AWS VPC subnet only actually gives you 251. Worth remembering before sizing a subnet around an exact host count for a cloud deployment.

This tool is built with ASP.NET Core 8, Blazor Server, and System.Net. It runs securely on Microsoft Azure.
Input Section
Enter an IPv4 address with CIDR prefix (0–32)
Quick examples
10.0.0.0/8
172.16.0.0/12
192.168.1.0/24
192.168.1.100/30
10.10.0.0/16
0.0.0.0/0
Output Section

Enter a CIDR block and click Calculate to see the subnet breakdown.