Enter an IPv4 address and CIDR prefix to compute subnet masks, network range, and host details.
Network Address
192.168.1.0/24
Subnet Mask255.255.255.0
Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Number of Hosts254
Wildcard Mask0.0.0.255
Subnet calculation uses bitwise AND operations on the IP and mask. Network address has all host bits set to 0; broadcast has all host bits set to 1.
Share
What is the IP Subnet Calculator?
An IP subnet calculator is a tool that takes an IPv4 address (e.g. 192.168.1.10) and a CIDR prefix (e.g. /24) and derives the subnet mask, network address, broadcast address, first and last usable host, total number of usable hosts, and wildcard mask. It applies bitwise AND and OR operations to reveal the boundaries and structure of the subnet.
How it works
The calculator converts the IP address to a 32-bit binary number and applies the subnet mask (generated from the CIDR prefix). The network address is found by setting all host bits to 0; the broadcast address sets all host bits to 1. Usable hosts exclude the network and broadcast addresses, so a /24 subnet has 2^(32−24)−2 = 254 usable hosts.
Network Address = IP AND Subnet Mask | Broadcast = Network Address OR Wildcard Mask | Total Hosts = 2^(32 − CIDR prefix) − 2
The AND operation with the subnet mask isolates the network portion of the IP. The OR with the wildcard (inverted mask) sets all host bits to 1, giving the broadcast address. The 2^(32−prefix)−2 formula counts all possible addresses in the subnet minus the network and broadcast addresses, which cannot be assigned to individual hosts.
A /30 subnet has only 4 addresses total; used for point-to-point links (routers, VPN endpoints) where exactly 2 hosts are needed.
How to use the IP Subnet Calculator
Enter the IPv4 address in dotted-decimal notation (e.g. 192.168.1.10).
Select or type the CIDR prefix from /0 to /32 (e.g. /24 for a 255.255.255.0 mask).
The tool calculates the subnet mask from the prefix using bitwise shifts.
Observe the network address, broadcast address, and usable host range.
Review the total number of usable hosts (2^(32−prefix)−2).
Note the wildcard mask (inverse of the subnet mask, used in ACLs and route filters).
Benefits
Speeds up network design by eliminating manual binary conversions.
Ensures accurate subnet boundaries to avoid overlaps and routing errors.
Helps plan VLAN allocation and IP address pools for organisations.
Essential for firewall rules, ACLs, and route summarisation (supernetting).
Supports both standard and classless (CIDR) addressing schemes.
Useful for security audits and documenting network topology.
Tips & common mistakes
Common mistakes
Confusing subnet mask and wildcard mask; the wildcard is the bitwise NOT of the mask (255.255.255.255 XOR mask).
Forgetting that /32 and /31 are special; /32 is a single host and /31 (point-to-point) has no broadcast, only 2 addresses total.
Assuming all subnets of the same prefix have the same usable range; network address depends on the input IP.
Tips
Memorise common prefixes: /8 (16 M hosts), /16 (65 K), /24 (254), /30 (2).
Use wildcard masks in firewall ACLs and OSPF networks statements; some tools expect this format.
For point-to-point links (e.g. router-to-router), use /30 or /31 to conserve addresses.
Document subnets with CIDR notation; it's more concise and universally understood than separate IP and mask fields.
Frequently asked questions
What's the difference between subnet mask and wildcard mask?
A subnet mask marks the network portion with 1s (e.g. 255.255.255.0 = 24 consecutive 1s). A wildcard mask is the inverse: it marks the host portion with 1s (e.g. 0.0.0.255 for a /24). Wildcard masks are used in ACLs, OSPF, and some firewall rules.
What does /32 mean?
/32 is a single host. There are no usable host bits, so the network address equals the IP address, and there is only 1 address in the subnet. Used for loopback interfaces and host routes.
Can I use this for IPv6?
This tool is for IPv4 only. IPv6 uses 128-bit addresses and different notation (e.g. 2001:db8::/32). You would need a separate IPv6 subnet calculator.
What is supernetting or route summarisation?
Supernetting combines multiple subnets under a single larger prefix to reduce routing table size. For example, 192.168.0.0/24 and 192.168.1.0/24 can be summarised as 192.168.0.0/23. This calculator helps identify which subnets can be summarised.
Why is the usable host count 2^(32−prefix)−2 and not 2^(32−prefix)?
The first address (all host bits 0) is the network address and the last (all host bits 1) is the broadcast address. Neither can be assigned to a host device. A /24 has 2^8 = 256 total addresses but only 254 usable (256 − 2).
What does RFC1918 mean and why is it relevant to subnetting?
RFC1918 reserves three ranges of private (non-routable) IPv4 addresses: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. You should use these ranges for internal networks rather than public addresses.