IPv4 subnet calculator

What is an Ipv4 Subnet Calculator?

Every IPv4 network is defined by an address and a prefix length, such as 192.168.10.0/26. From that, you can derive the subnet mask, the network and broadcast addresses, the range of usable host addresses and how many devices fit. This calculator does all of that instantly, which is essential for planning networks, configuring routers and writing firewall rules.

How to use it

  1. Enter an address with a CIDR prefix, for example 192.168.10.37/26.
  2. Read the network details.

Worked example: 192.168.10.37/26

  • Subnet mask: 255.255.255.192 (26 ones followed by 6 zeros)
  • Wildcard mask: 0.0.0.63, used in Cisco ACLs and OSPF
  • Network address: 192.168.10.0
  • Broadcast address: 192.168.10.63
  • Usable hosts: 192.168.10.1 to 192.168.10.62, which is 62 hosts

The math

Host bits = 32 - prefix = 6. Addresses per subnet = 2^6 = 64. Usable hosts = 64 - 2, because the network and broadcast addresses cannot be assigned to devices. The network address is found by ANDing the IP with the mask: 37 AND 192 = 0.

Quick reference

  • /24: 256 addresses, 254 hosts
  • /25: 128 addresses, 126 hosts
  • /26: 64 addresses, 62 hosts
  • /27: 32 addresses, 30 hosts
  • /28: 16 addresses, 14 hosts
  • /30: 4 addresses, 2 hosts, classic for point-to-point links
  • /31: 2 addresses, both usable on point-to-point links (RFC 3021)

Cloud note

AWS, Azure and Google Cloud reserve extra addresses in every subnet (AWS reserves 5), so a /28 in AWS gives 11 usable addresses, not 14.

Frequently Asked Questions

How many hosts are in a /24 subnet?

256 addresses, of which 254 can be assigned to hosts.

What is a wildcard mask?

The inverse of the subnet mask, used by Cisco ACLs and OSPF. For a /26, it is 0.0.0.63.

Why are two addresses not usable?

The first address identifies the network and the last is the broadcast address, so neither can be assigned to a device.

Why does my cloud subnet have fewer usable IPs?

Cloud providers reserve some addresses in each subnet for routers, DNS and future use. AWS reserves five.