Skip to content

IPv4 subnet calculator (CIDR)

Compute network address, broadcast, mask and host count from an IP and CIDR prefix.

Network address
192.168.1.0/24
Subnet mask255.255.255.0
Broadcast192.168.1.255
Host range192.168.1.1 – 192.168.1.254
Usable hosts254

How the calculation works

The CIDR prefix (e.g. /24) defines the mask. The network address is IP AND mask; the broadcast fills the host bits with 1. Usable hosts = 2^(32−prefix) − 2.

Examples

  • /24 (255.255.255.0): 256 addresses, 254 usable hosts.
  • /30: only 2 hosts — used for point-to-point router links.

Frequently asked questions

Why "− 2" hosts?

One address is the network and another is the broadcast; neither can be assigned to a host.

What is the CIDR prefix (/24)?

How many IP bits define the network. /24 = 24 network bits and 8 host bits, giving 256 addresses.

Why divide into subnets?

To organize and isolate parts of the network, improve security and reduce broadcast traffic.

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

Two addresses are reserved: the network address and the broadcast. In practice the gateway takes a third.

What are the private IP ranges?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are never routed on the internet, so many homes share 192.168.0.1.

Which prefix should I choose?

Count devices and leave room. A /24 (254 hosts) suits homes and small offices; larger networks benefit from segmentation.

Related calculators

More Tech / IT calculators

See all →

Updated on June 18, 2026 · by Rafael Rossi · Methodology & sources