Skip to content
snip tools

IPv4 subnet calculator

Enter an IPv4 address and CIDR prefix to see the network, broadcast, host range, mask and wildcard.

Runs 100% in your browser

How to calculate a subnet

  1. Enter an IP and prefix. Type a dotted-decimal IPv4 address and a CIDR prefix between /0 and /32.
  2. Read the breakdown. Network, broadcast, first/last host, mask, wildcard and host count update instantly.
  3. Copy or share. Use the Copy button to grab the summary block as text.

What subnetting actually does

Subnetting borrows bits from the host portion of an address to carve one network into several smaller ones, so addresses are handed out where they are needed and routers can summarise whole ranges instead of tracking individual hosts. A CIDR prefix like /24 states the split directly: the first 24 bits identify the network and the remaining 8 identify hosts within it. Give this tool any address and prefix and it derives the whole block around that host — which network the address belongs to, where the block ends, and every usable address in between — so you can confirm two machines share a subnet or design an allocation before touching a router.

Reading the breakdown

The network address is the all-zeros host (the block's name) and the broadcast address is the all-ones host (a message to every device on it) — neither is assignable to a machine, which is why the usable host count is two fewer than the total. The subnet mask (255.255.255.0 for a /24) and its inverse the wildcard (0.0.0.255) encode the same boundary in dotted form; the wildcard is what Cisco ACLs and OSPF expect, where a 1 bit means "ignore this bit when matching". The result also flags the address class and whether it falls inside the RFC 1918 private ranges (10/8, 172.16/12, 192.168/16), loopback or link-local.

The /31 and /32 edge cases

The "subtract two" rule breaks down at the smallest blocks. A /32 is a single address — a host route, used for a loopback or a one-address firewall rule — with no network or broadcast to reserve. A /31 would normally have zero usable hosts, so RFC 3021 redefines it: both addresses become usable for a point-to-point link between two routers, saving the two addresses a /30 would waste. This calculator applies those exceptions automatically. Every figure is computed in your browser with plain bit arithmetic, so no IP address you type ever leaves the page.

Frequently asked questions

What is a subnet calculator?
It splits an IP address and CIDR prefix into the network and broadcast addresses, the usable host range, the subnet mask and wildcard, and the host count. Used to plan IP allocations and ACLs.
Does the calculation run locally?
Yes. All subnet math happens in your browser — nothing is sent to a server. The TrustChip above confirms the page makes no network calls.
How are /31 and /32 subnets handled?
A /32 has a single host (a host route). A /31 is treated per RFC 3021 — both addresses are usable for a point-to-point link rather than reserved as network and broadcast.
What is the wildcard mask?
The bitwise NOT of the subnet mask. Used in ACLs and routing protocols (OSPF) where a 1-bit means "ignore this bit".
Is the address public or private?
The result lists the IP class (A–E) and whether the address falls inside the RFC 1918 private ranges 10/8, 172.16/12 or 192.168/16, plus loopback and link-local.