Computer & IT

IPv4 Subnet & Address Range Calculator

Network, broadcast and usable host range of an IPv4 subnet from CIDR or subnet mask.

Inputs

Any address in the subnet, e.g. 192.168.1.25. You may also type it with a prefix, e.g. 192.168.1.25/26 — that prefix is then used.

Result

Network address
192.168.1.0/24
Usable host range
192.168.1.1 – 192.168.1.254
Broadcast address
192.168.1.255
Usable host addresses
254
Total addresses in the subnet
256
Subnet mask
255.255.255.0 (/24)
Wildcard mask
0.0.0.255
Type of the address entered
Private address (RFC 1918)
Binary (address / mask)
11000000.10101000.00000001.00011001 11111111.11111111.11111111.00000000

The subnet 192.168.1.0/24 contains 256 addresses. Hosts can use 192.168.1.1 – 192.168.1.254 (254 addresses).

Educational estimate — check the assumptions below.

About this calculator

Every IPv4 address belongs to a subnet, defined by a prefix length (CIDR, such as /24) or the equivalent subnet mask (255.255.255.0). Enter any address and its prefix or mask to find the subnet’s network address, broadcast address, the range of addresses that devices can use, and how many there are. Use it when planning a workshop or office network, setting a fixed address on a PLC, printer or CNC machine, or checking why two devices cannot see each other.

This is a calculator only: it works out addresses from the numbers you type and does not scan or contact any network.

Formula

Network = address AND mask    Broadcast = network OR (NOT mask)

Total addresses = 2(32 − prefix)    Usable hosts = 2(32 − prefix) − 2

Usable hosts run from network + 1 to broadcast − 1. Special cases: a /31 has two addresses, both usable on a point-to-point link (RFC 3021); a /32 is a single address. Wildcard mask = NOT mask (used in router access lists).

Worked example

  • 192.168.1.25/24: network 192.168.1.0, broadcast 192.168.1.255, hosts 192.168.1.1 – 192.168.1.254 (254 usable of 256).
  • 192.168.1.25/26 (mask 255.255.255.192): network 192.168.1.0, broadcast 192.168.1.63, hosts .1 – .62 (62).
  • 10.20.30.40/20: network 10.20.16.0, broadcast 10.20.31.255, 4094 usable hosts.

Assumptions and limitations

  • IPv4 only. Leading zeros in an octet (such as 010) are rejected because some systems read them as octal.
  • Usable-host counts assume the normal convention that the network and broadcast addresses are not given to devices (except /31 and /32). The router or gateway also uses one of the usable addresses.
  • Address types are identified from the IANA special-purpose ranges in the RFCs named; local network policies may differ.

References

  • IETF RFC 791 (Internet Protocol), RFC 4632 (CIDR), RFC 950 (subnetting), RFC 3021 (/31 point-to-point links), RFC 1918 (private addresses), RFC 6890 (special-purpose address registries).