Home › 🔬 Math & Science › Subnet Calculator (IPv4)

Subnet Calculator (IPv4)

Enter an IP address and prefix length to see the network, broadcast, subnet mask, wildcard mask and usable host range instantly.

Updated 24 November 2026 · Free · No sign-up · Your data stays on your device

By Mohd Huzaifa✓ Formulas checked against official sourcesLast reviewed: 24 November 2026
Result

Examples

  • 192.168.1.10/24: network 192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0, usable hosts 192.168.1.1–192.168.1.254 (254 hosts).
  • 10.20.30.40/20: network 10.20.16.0, broadcast 10.20.31.255, mask 255.255.240.0, usable hosts 10.20.16.1–10.20.31.254 (4,094 hosts).

How subnetting works

An IPv4 address is 32 bits. The CIDR prefix (/24, /20…) says how many of those bits identify the network; the rest identify hosts. The network address has all host bits set to 0 and the broadcast address has them all set to 1, so a subnet has 2(32 − prefix) addresses and 2 fewer usable hosts. /31 point-to-point links and /32 single hosts are exceptions.

Common subnet sizes

CIDRSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

Private address ranges (RFC 1918)

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16

These can be used inside any private network and aren't routed on the public internet. 100.64.0.0/10 is reserved for carrier-grade NAT.

Worked example

IP address 192.168.1.10 with prefix /24 (mask 255.255.255.0): network address 192.168.1.0, broadcast 192.168.1.255, usable hosts 192.168.1.1 to 192.168.1.254 (254 hosts = 28 − 2). It's a private class C range (RFC 1918).

Frequently asked questions

What is a subnet mask?

A 32-bit number that marks which part of an IP address is the network and which part is the host. /24 is the same as 255.255.255.0.

How many hosts are in a /24?

256 addresses, of which 254 can be given to devices; the first is the network address and the last is the broadcast address.

What is a wildcard mask?

The inverse of the subnet mask (255.255.255.255 minus the mask). It's used in Cisco access lists and OSPF configuration, for example 0.0.0.255 for a /24.

Does this work for IPv6?

This calculator is for IPv4. IPv6 subnets are normally /64 for a single network, with 2⁶⁴ addresses.

Sources & references

✍️ Built and checked by Mohd Huzaifa, founder of EasyCalcAI · Last updated 24 November 2026. The calculator uses the formula shown on this page; results are estimates for planning, not professional advice.