Hire me

IP Subnet Calculator (IPv4)

Enter an IP address with a CIDR prefix to see the network, broadcast, mask and usable hosts.

  • Free, no sign-up
  • Code stays in your browser
  • Works on phone and desktop

The calculator applies the subnet mask to the IP address to find the network and broadcast addresses, the first and last usable hosts, the number of usable hosts (2<sup>32−prefix</sup> − 2), the wildcard mask for ACLs and the IP class and type.

How to calculate a subnet

  1. Enter an IPv4 address with a prefix, such as 10.0.5.20/22.
  2. Read the network range and masks.
  3. Use the table to compare common prefix sizes.

CIDR cheat sheet

PrefixNetmaskUsable hosts
/30255.255.255.2522
/29255.255.255.2486
/28255.255.255.24014
/27255.255.255.22430
/26255.255.255.19262
/25255.255.255.128126
/24255.255.255.0254
/23255.255.254.0510
/22255.255.252.01,022
/16255.255.0.065,534

Frequently asked questions

Why subtract 2 hosts?

The first address is the network address and the last is the broadcast address; neither can be assigned to a device. /31 and /32 are special cases.

Updated October 2026 · Built and tested by Sharjeel Tahir · How our tools are tested