NewNew: GlanceDesk Compute, checked engineering calculators for civil, electrical and HVAC work. See what comes next.
GlanceDeskCompute

Ask an engineering tool

Try:

Answers come from the same tested tools. Nothing you type leaves your device.

IP Subnet Calculator (IPv4 CIDR, Netmask and Host Range)

Any address in the subnet, for example 192.168.1.10. A "/24" typed here is read as the prefix.

The numbers filled in are examples. Type your own.

bits
The number after the slash: /24 is the netmask 255.255.255.0.

Enter an IPv4 address and its prefix length (the number after the slash, as in /24). See the network and broadcast addresses, the first and last usable host, the netmask and how many hosts the subnet holds.

Usable host addresses
–
Network address
–
Broadcast address
–
First usable host
–
Last usable host
–
Netmask
–
Wildcard mask
–
Network in CIDR notation
–
Addresses in the block
–

Assumptions

  • IPv4 only. The prefix length counts the leading 1-bits of the netmask (RFC 4632).
  • The all-0s host address names the network and the all-1s address is the broadcast, so neither is a host (RFC 1122).
  • A /31 is treated as a point-to-point link with two host addresses (RFC 3021); a /32 is one address.

Checked 29 October 2026 RFC 4632 (BCP 122, 2006): Classless Inter-domain Routing (CIDR), prefix notation and block sizes All sources

How it is calculated

  • Addresses in the block = 2^(32 − prefix length)
  • Netmask = prefix length 1-bits followed by 0-bits; wildcard mask = its inverse
  • Network address = the address with all host bits set to 0; broadcast = all host bits set to 1
  • Usable hosts = addresses − 2 (network and broadcast); a /31 has 2 (RFC 3021) and a /32 has 1

Worked example

The address 192.168.1.10 in a /24 subnet.

You enter
IPv4 address192.168.1.10
Prefix length24 bits
You get
Usable host addresses254
Network address192.168.1.0
Broadcast address192.168.1.255
First usable host192.168.1.1
Last usable host192.168.1.254
Netmask255.255.255.0
Wildcard mask0.0.0.255
Network in CIDR notation192.168.1.0/24
Addresses in the block256

The subnet 192.168.1.0/24 has 256 addresses, from 192.168.1.0 to 192.168.1.255. 254 of them can be given to hosts: 192.168.1.1 to 192.168.1.254. Netmask 255.255.255.0.

Questions

Why are there two fewer hosts than addresses?

The first address of a subnet names the network itself and the last is the broadcast address. RFC 1122 says neither may be given to a host, so a /24 has 256 addresses and 254 hosts.

What about /31?

RFC 3021 lets a /31 be used on a point-to-point link, such as between two routers: both addresses are host addresses and there is no broadcast. Older equipment that does not support it may not work on such a link.

Sources and checks

Last checked: 29 October 2026. This tool passes 11 automatic tests before every release. How we check our tools

Cite this page

IP Subnet Calculator (IPv4 CIDR, Netmask and Host Range). GlanceDesk Compute. Last checked 29 October 2026. https://glancedeskcompute.com/ip-subnet-calculator/

Found a wrong number? Tell us

Your numbers stay on your device unless you share them.

For planning and learning. Your router or cloud provider may reserve more addresses in a subnet (for gateways or services); check its documentation. Results are estimates for planning and learning. They are not a design check and do not replace a qualified engineer or your local building/electrical code.

Related tools

Missing something? Suggest a tool