IP Subnet Calculator

IP Subnet Calculator

Calculate IP subnets, network ranges, broadcast addresses, CIDR notation. IPv4 subnet mask calculator. Free online IP/CIDR calculator for network admins

CIDR notation hides what is actually a sequence of bitwise AND operations on 32-bit integers. Most "why does my route not match" bugs trace back to confusing /24 (the mask is 255.255.255.0) with /23 (255.255.254.0 — twice as many hosts, network number must end in even third octet). This calculator takes an address with a CIDR or netmask, prints the network address, broadcast, usable host range, total addresses, and the wildcard mask for ACL configs.

What CIDR actually says

CIDR (Classless Inter-Domain Routing, RFC 4632) replaces the old class A/B/C scheme with an explicit prefix length. 192.168.1.0/24 means "the first 24 bits identify the network, the remaining 8 bits identify the host". Each prefix length doubles or halves the address space:

  • /8 → 16,777,216 addresses (a /8 like 10.0.0.0/8 is a whole private cloud)
  • /16 → 65,536 addresses (typical large corporate LAN)
  • /24 → 256 addresses (254 usable hosts after network + broadcast — typical home/SMB subnet)
  • /29 → 8 addresses (6 usable — small point-to-point segments)
  • /30 → 4 addresses (2 usable — router-to-router links)
  • /31 → 2 addresses, no network/broadcast (RFC 3021; both usable for point-to-point links)
  • /32 → 1 address (single host route, "loopback to self")

Working example

Input

10.42.17.130/26

Output

Prefix:        10.42.17.130/26
Netmask:       255.255.255.192
Wildcard:      0.0.0.63       (for Cisco ACLs and OSPF)
Network:       10.42.17.128
Broadcast:     10.42.17.191
First host:    10.42.17.129
Last host:     10.42.17.190
Usable hosts:  62
Total addrs:   64

Binary:
  Address:   00001010.00101010.00010001.10000010
  Netmask:   11111111.11111111.11111111.11000000
  Network:   00001010.00101010.00010001.10000000   (AND)
  Broadcast: 00001010.00101010.00010001.10111111   (OR with inverse)

A /26 has 26 prefix bits + 6 host bits. 2^6 = 64 addresses; subtract network address (10.42.17.128) and broadcast (10.42.17.191) → 62 usable hosts.

Practical patterns

  • AWS VPC sizing — your VPC CIDR is fixed at creation; sub-allocate /24s for subnets across AZs. AWS reserves 5 addresses per subnet (.0, .1, .2, .3, broadcast), so a /28 only gives you 11 usable hosts.
  • GCP and Azure subnets — similar reservation rules. A /29 in GCP gives 3 usable IPs, not 6.
  • Kubernetes Service CIDR / Pod CIDR — typically /16 for services and /16 or larger for pods. Going smaller breaks scale; overlapping with VPC CIDR breaks routing.
  • Cisco ACL wildcards — the inverse of the netmask. /24 mask = 255.255.255.0; wildcard = 0.0.0.255. Always validate wildcard direction; reversing it permits the wrong traffic.
  • Supernetting — combining adjacent /25s into a /24 only works if both /25s share the network bits up to that point. 10.0.0.0/25 + 10.0.0.128/25 → 10.0.0.0/24, ✓. 10.0.0.0/25 + 10.0.1.0/25 → no, they are not adjacent in the bit tree.

When to reach for this tool

  • You are designing a VPC for a new environment and need to verify your /16 has room for the subnet plan you wrote on a whiteboard.
  • You are debugging "this route does not match" and need to confirm 10.0.0.0/16 actually includes 10.0.255.42 (it does — /16 covers 10.0.0.0 through 10.0.255.255).
  • You are writing firewall rules and want to verify the Cisco wildcard 0.0.3.255 corresponds to a /22 mask, not /24.
  • You inherited a /23 subnet split between two VLANs and need to figure out the boundaries to suggest a clean re-split.

What this tool will not do

  • It will not handle IPv6 the same way. IPv6 CIDR works conceptually identically but the address space (/128, 2^128 total) and the absence of broadcast change practical sizing. A separate IPv6 calculator is required for ::/N math and EUI-64 host portions.
  • It will not validate against your actual routing table. The math says 192.168.1.0/24 is reachable; whether your default gateway can actually route there depends on configuration you have to inspect separately.
  • It will not warn about RFC 1918 vs public addresses. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are private; everything else is treated as public by NAT and most firewalls. Picking a private range outside the RFC 1918 set will conflict with someone's real internet address.

Frequently asked questions

Why is the usable host count "address space minus 2"?

The first address in the subnet is the network address (used for routing); the last is the broadcast address (sent to all hosts in the subnet). Neither can be assigned to a host. Exception: /31 and /32 subnets use both addresses per RFC 3021 (point-to-point) and RFC 4632 (single host).

How many /24s fit in a /16?

2^(24-16) = 2^8 = 256 /24 subnets. The first is 10.0.0.0/24, the last is 10.0.255.0/24 (assuming the parent is 10.0.0.0/16).

What is the difference between netmask 255.255.255.0 and 255.255.255.252?

255.255.255.0 is /24 (256 addresses). 255.255.255.252 is /30 (4 addresses, 2 usable). The /30 is the classic "router-to-router point-to-point link" mask — minimal address waste while still having two assignable hosts.

Why can't I use 192.168.1.0 as a host IP?

On a /24 it is the network address. On a different prefix length the same dotted-quad can be a valid host. 192.168.1.0/16 has 192.168.1.0 in the middle of the range; 192.168.1.0/24 has it as the network. Context matters.

How do I find whether two IPs are in the same subnet?

AND both addresses with the netmask. If the results are identical, they are in the same subnet. 10.0.1.5 AND 255.255.255.0 = 10.0.1.0; 10.0.1.99 AND 255.255.255.0 = 10.0.1.0. Same network → same subnet.

What is the difference between a /24 and a Class C?

Conceptually equivalent — both have 24 network bits and 256 addresses. "Class C" is the pre-1993 classful term; /24 is the CIDR term. Use /24 in any modern context. Classful addressing is dead and was only relevant when address class was implied by the first octet.

Related tools

Last updated · E-Utils editorial team