IP Subnet Calculator

Calculate network address, broadcast address, subnet mask, and usable host range from an IP and CIDR.

⏱ Updated: 18 Sep 2026

Calculator

Free IPv4 subnet calculator: network address, broadcast address, subnet mask, and usable host range from an IP and CIDR prefix.

Enter an IPv4 address and CIDR prefix length to calculate its subnet details.

How to Use the IP Subnet Calculator

Enter an IPv4 address and a CIDR prefix length from 0 to 32 — the subnet mask, network and broadcast addresses, usable host range, and total address count update as you type.

A subnet is just a contiguous block of IP addresses carved out for one network segment — one office, one VLAN, one cloud subnet. CIDR notation says how big that block is by naming how many of the address's 32 bits are fixed. /24 means the first 24 bits are the network portion, leaving 8 bits — 256 possible values — for host addresses on that segment.

subnet mask = 32 bits, with the first N bits set to 1 (N = CIDR prefix) and the rest 0
network address = IP address AND subnet mask
broadcast address = network address OR (NOT subnet mask)

Why /31 and /32 Show Zero Usable Hosts

Every other prefix reserves the block's first address as the network address and its last as the broadcast address, leaving the total minus those two as usable. /31 and /32 are exceptions. A /32 is a single host route — one address, nothing to subtract. A /31, per RFC 3021, is meant for point-to-point links between two routers and uses both addresses in the pair with no separate network or broadcast address at all — so "0 usable hosts" doesn't mean the subnet is useless, just that the traditional split doesn't apply to it.

Total addresses is always 2 raised to (32 minus the prefix length) — a /24 spans 256 addresses, a /16 spans 65,536, doubling every time the prefix drops by one bit.