Subnet Calculator

Enter an IPv4 CIDR block to get its network address, broadcast address, netmask, wildcard mask, usable host range and host count.

Address and prefix, for example 192.168.1.0/24. A bare address is treated as /32.

Usable host addresses

254

192.168.1.0/24 contains 256 addresses in total.

  • Network address192.168.1.0
  • Broadcast address192.168.1.255
  • Subnet mask255.255.255.0
  • Wildcard mask0.0.0.255
  • First usable host192.168.1.1
  • Last usable host192.168.1.254
  • Total addresses256
  • CIDR notation192.168.1.0/24
  • Address is the network address of this block.
  • The network and broadcast addresses are reserved, which is why usable hosts is two fewer than the total.

How it works

usable hosts = 2^(32 − prefix) − 2 for prefixes /30 and shorter; /31 and /32 are special cases

Sources

  • RFC 950 — Internet Standard Subnetting Procedure (1985)
  • RFC 4632 — CIDR Address Strategy (2006)
  • RFC 1918 — Address Allocation for Private Internets
  • RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links

Questions

Why are there two fewer usable hosts?

The first address identifies the network itself and the last is the broadcast address, so neither can be assigned to a device. /31 (point-to-point) and /32 (single host) are exceptions.

What is a wildcard mask for?

It is the bitwise inverse of the subnet mask. Access control lists on routers use wildcard masks to match address ranges, where a 0 means "must match" and a 1 means "ignore".

Does this work for IPv6?

No — this calculator is IPv4 only. IPv6 subnets use a prefix from 0 to 128 and do not reserve a broadcast address, so the arithmetic is different.