Skip to content

IP Subnet Calculator

Calculate the network, broadcast, mask, host range and host count from an IP and CIDR.

Calculated locally in your browser.

0–32, e.g. 24 for a 255.255.255.0 mask.

How do you calculate a subnet from an IP and CIDR?

The mask has the top CIDR bits set: network = IP AND mask, broadcast = network OR wildcard, and usable hosts = 2^(32 − prefix) − 2 (for prefixes up to /30). For example, 192.168.1.10/24 has network 192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0 and 254 usable hosts.

Understanding your result

A /31 has 2 addresses (point-to-point links) and a /32 is a single host, so the usual “minus 2” rule doesn’t apply to them.

Formula and method

The mask has the top CIDR bits set. Network = IP AND mask; broadcast = network OR wildcard; usable hosts = 2^(32 − prefix) − 2 (for prefixes up to /30).

Worked example

192.168.1.10/24 has network 192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0 and 254 usable hosts.

How to use this tool

  1. Enter an IPv4 address such as 192.168.1.10.
  2. Enter the CIDR prefix length (0–32).
  3. Press Calculate.

About the IP Subnet Calculator

The IP Subnet Calculator breaks down an IPv4 address and CIDR prefix into its network and broadcast addresses, subnet mask, wildcard mask, usable host range and total hosts.

Explore all Developer Tools tools

Frequently asked questions

What does the CIDR number mean?

It’s how many leading bits are the network portion. /24 means the first 24 bits are the network, leaving 8 bits (256 addresses) for hosts.

Share this tool

Free to use — copy the link, share it anywhere, or add the tool to your own website.

Embed this tool on your site (free)

Copy this code and paste it into any web page — it stays free and always up to date: