Free networking calculator

Subnet Calculator

Calculate IPv4 CIDR ranges, subnet masks, wildcard masks, network and broadcast addresses, usable hosts, and the smallest subnet size for a host count.

  • IPv4 CIDR
  • Subnet mask
  • Wildcard mask
  • Usable hosts

CIDR inputs

Enter an IPv4 address and prefix

This calculator covers IPv4 subnet math. It treats /31 and /32 as valid special-purpose ranges, while the host planner below recommends traditional LAN-sized blocks.

Subnet result

CIDR breakdown

Calculated block192.168.1.25/24
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Total addresses
256
Usable hosts
254
Network CIDR
192.168.1.0/24
Binary mask
11111111.11111111.11111111.00000000
Usable range
192.168.1.1 - 192.168.1.254
Address type
Private RFC1918 address range

Subnet sizing

Find a subnet size from host count

Enter the number of usable devices you need and the planner recommends the smallest traditional IPv4 subnet block that can hold them.

Recommended prefix
Subnet mask
Block size
Usable hosts

The host planner avoids /31 and /32 recommendations because most LAN planning still reserves network and broadcast addresses.

How subnet calculation works

IPv4 addresses are 32-bit numbers usually written as four decimal octets. CIDR notation, such as 192.168.1.25/24, says how many of those bits belong to the network portion. The remaining bits are available for host addresses inside that block.

The subnet mask is the dotted-decimal version of the network bits. A /24 prefix becomes 255.255.255.0 because the first 24 bits are set to 1 and the last 8 bits are host bits.

Network address, broadcast address, and usable hosts

The network address is the first address in the block. The broadcast address is the last address in most IPv4 subnets. Traditional LAN subnets reserve both, so a /24 has 256 total addresses and 254 usual host addresses.

A /31 is a special case commonly used for point-to-point links, and a /32 identifies a single host route. This calculator shows those ranges as valid, but the host planner recommends traditional blocks for ordinary device networks.

Wildcard masks

A wildcard mask is the inverse of the subnet mask. Network teams often see wildcard masks in access control lists and routing configurations. For example, 255.255.255.0 has a wildcard mask of 0.0.0.255.

If the subnet mask bits say which bits must match, the wildcard bits say which bits can vary. That makes wildcard masks useful when a rule needs to match a whole subnet instead of one host.

Common subnetting mistakes

Common mistakes include forgetting to subtract network and broadcast addresses, confusing /24 with 24 usable hosts, or typing an address from inside a subnet and assuming it is the network address. The network address is calculated from the address and prefix together.

When planning a real network, leave room for gateways, printers, virtual machines, DHCP reservations, monitoring systems, and future growth. A subnet that fits exactly on paper can become frustrating once devices are added.