Subnet Calculator

Network, broadcast, usable hosts and masks for an IPv4 CIDR block.

Quick answer

  • Formula: Network = IP AND mask; Broadcast = Network OR (NOT mask); Hosts = 2^(32 − prefix)
  • Worked example — Network address: 192.168.1.0 (full example below).

Subnet Calculator

Worked example result
Network address192.168.1.0
Broadcast address192.168.1.255
First usable host192.168.1.1
Last usable host192.168.1.254
Total addresses256
Usable hosts254
Subnet mask255.255.255.0
Wildcard mask0.0.0.255

192.168.1.10/24 sits in network 192.168.1.0 with broadcast 192.168.1.255 and 254 usable hosts, .1 through .254.

Enter an IPv4 address and a CIDR prefix length to get the network address, broadcast address, first and last usable host addresses, the subnet and wildcard masks, and the host counts for the block.

For prefixes /0 to /30, two addresses per block are reserved (network and broadcast), leaving total − 2 usable hosts. The special cases follow common practice: a /31 point-to-point link has 2 usable addresses and a /32 is a single host route.

The formula

Network = IP AND mask; Broadcast = Network OR (NOT mask); Hosts = 2^(32 − prefix)

Worked example

192.168.1.10/24 sits in network 192.168.1.0 with broadcast 192.168.1.255 and 254 usable hosts, .1 through .254.

The example is pre-loaded in the result panel — press Calculate with your own numbers to replace it.

Frequently asked questions

Why does a /24 have 254 usable hosts, not 256?

A /24 block has 2^8 = 256 addresses, but the first is the network address and the last is the broadcast address, leaving 254 for hosts.

What is a wildcard mask used for?

It is the bitwise inverse of the subnet mask and is used in router ACLs and OSPF statements, where 0 bits mean 'must match' and 1 bits mean 'ignore' — the opposite convention to a subnet mask.

Category: Everyday Life calculators

Sources & methodology

This calculator applies the formula shown on this page exactly as written, using the standard definitions for its inputs. Results are computed from the values you enter — no data is stored — and are rounded only for display.

Content last reviewed by CalcHub Editorial.

Embed this calculator on your site

Free to use with attribution — paste the snippet below and the calculator appears on your page, with a link back to CalcHub.

<iframe src="https://calculator-site-57a.pages.dev/embed/subnet-calculator" width="100%" height="640" style="border:1px solid #d9e2ea;border-radius:12px" loading="lazy" title="Subnet Calculator — CalcHub"></iframe>

Open the embed version →