Subnet Calculator
Calculate the network address, broadcast, subnet and wildcard masks, host range and usable host count for any IPv4 address and CIDR prefix.
Result
Subnetting questions appear everywhere — configuring a router, sizing a VLAN, writing a firewall rule, studying for a networking exam — and they all reduce to the same bit arithmetic: apply the mask, find the network, find the broadcast, count what is left in between. This calculator does exactly that for any IPv4 address and any CIDR prefix from /8 to /30, returning the network address, broadcast address, subnet mask, wildcard mask, the first and last usable host and both address counts in one pass.
The math is transparent rather than magical. A prefix /p means p network bits, so the subnet mask is p ones followed by zeros, the wildcard mask is its bitwise inverse, the network address is IP AND mask, and the broadcast is the network OR wildcard. The remaining 32 − p host bits give 2^(32−p) total addresses, of which 2^(32−p) − 2 are usable because the all-zeros and all-ones combinations are reserved. A /24 therefore holds 254 hosts, a /16 holds 65,534, and a /30 exactly 2 — the point-to-point classic.
Beyond the numbers you also get context: a class note explains what the first octet of your address implies — the historical class A/B/C boundaries that pre-CIDR equipment assumed, the 127.0.0.0/8 loopback block and other reserved ranges. Preset pages cover the prefixes people actually search for: /24 for LANs, /16 for large private networks and /30 for router links.
Like every tool on this site, the subnet calculator runs entirely in your browser using 32-bit integer operations — no server call, no logging of your network layout, and full offline operation once the page is open. Copy the complete result summary with one click and paste it straight into documentation or a ticket.