IP Subnet Calculator — CIDR Network, Hosts, Range
Enter any IPv4 host address and a CIDR prefix length (0–32) to instantly calculate the network address, broadcast address, subnet mask, wildcard mask, first and last host, and the number of usable host addresses.
/
Network: 192.168.1.0/24 • Subnet mask: 255.255.255.0
- 1
Host bits
32 − 24 = 8 - 2
Total addresses
2⁸ = 256 - 3
Usable hosts
256 − 2 = 254Subtract the network address and the broadcast address.
How does this calculator work?
Enter an IPv4 address and a CIDR prefix (e.g. 192.168.1.0 /24). The calculator ANDs the address with the subnet mask to find the network address, ORs it with the wildcard for broadcast, and gives usable hosts = 2^(32−prefix) − 2 (e.g. 254 for /24). All host, mask, and range details shown.
Formula
How this is calculated
A subnet mask is a 32-bit number with `prefix` leading 1s and the remaining bits as 0s. For a /24 subnet, the mask is 11111111.11111111.11111111.00000000 = 255.255.255.0. The bitwise AND of the host address and the mask gives the network address (the first address in the subnet). The wildcard mask is the bitwise complement of the subnet mask; OR-ing the network address with the wildcard gives the broadcast address (the last address). The number of usable host addresses is 2^(32−prefix) − 2, subtracting the network and broadcast addresses which cannot be assigned to hosts.
Two special cases follow RFC standards: a /31 subnet (RFC 3021) contains exactly 2 addresses, both usable — used for point-to-point links. A /32 is a single-host route with no network or broadcast address.
CIDR (Classless Inter-Domain Routing) replaced the old class-based system and is universal in modern IP networking. A /24 block has 254 usable hosts, /22 has 1022, /16 has 65 534. Subnetting allows network engineers to partition a larger block into smaller segments to improve security, reduce broadcast domains, and allocate addresses efficiently.
Frequently asked questions
The subnet mask has 1s in the network portion and 0s in the host portion. The wildcard mask is the bitwise NOT of the subnet mask — 0s in the network portion and 1s in the host portion. Wildcard masks are used in Cisco ACLs and OSPF area statements to match ranges of addresses.
The first address in every subnet (all host bits 0) is the network address, used to identify the subnet itself. The last address (all host bits 1) is the broadcast address, used to send a packet to all hosts in the subnet. Neither can be assigned to a device. For /31 and /32 subnets this convention is waived by RFC 3021 and host routing.
Each extra bit you take from the host portion doubles the number of subnets and halves the hosts per subnet. A /24 (254 hosts) split with /25 gives two subnets of 126 hosts each; /26 gives four subnets of 62 hosts each; /27 gives eight subnets of 30 hosts each. Run this calculator with the first address of each sub-block to confirm the ranges.
Also known as
TG we-Calculate Editorial Team. (2026). IP Subnet Calculator — CIDR Network, Hosts, Range [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/ip-subnet-calculator
TG we-Calculate Editorial Team. "IP Subnet Calculator — CIDR Network, Hosts, Range." TG we-Calculate. 2026. https://we-calculate.com/calculator/ip-subnet-calculator.
TG we-Calculate Editorial Team, "IP Subnet Calculator — CIDR Network, Hosts, Range," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/ip-subnet-calculator
@misc{wecalculate_ip_subnet_calculator, title = {IP Subnet Calculator — CIDR Network, Hosts, Range}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/ip-subnet-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
