Skip to content
Text & Dev Tools

Subnet / CIDR Calculator

Enter an IPv4 address and a CIDR prefix to compute the network, broadcast, masks, host range, and address counts.

What this does: this tool calculates IPv4 subnet details from an IP address and a CIDR prefix (/0 to /32). It returns the network address, broadcast address, subnet mask and wildcard mask, the first and last usable host, and the total and usable address counts. Every calculation runs in your browser with no signup or server upload.

Frequently asked questions

What is a CIDR prefix and how does it relate to the subnet mask?

A CIDR prefix such as /24 is the number of leading bits set to 1 in the subnet mask. A /24 means the first 24 bits are the network portion, which equals the dotted mask 255.255.255.0. Larger prefixes leave fewer bits for hosts, so they define smaller subnets with fewer usable addresses.

Why do a /31 and a /32 show different usable host counts?

Normally a subnet reserves the first address as the network and the last as the broadcast, so usable hosts equal total addresses minus two. A /31 is a special case defined by RFC 3021 for point-to-point links, where both addresses are usable, giving 2 hosts. A /32 describes a single host, so it has exactly 1 usable address.

Is this subnet calculator accurate and does it work offline?

Yes. All math is done in your browser with unsigned 32-bit integer operations, so results are exact for any valid IPv4 address and prefix from /0 to /32. Nothing is sent to a server, and the page keeps working offline once it has loaded.