Tip: Press Ctrl+Enter to run
Subnet Calculator
A subnet calculator is an essential tool for network engineers and sysadmins working with IPv4 addressing.
Enter an IP address and a CIDR prefix length (e.g. /24) to instantly compute the network address,
broadcast address, first and last usable host IPs, subnet mask, and the total number of hosts in that subnet.
No installation needed — everything runs in your browser.
Common Subnet Masks Reference
What this tool does
Enter an IPv4 address and a CIDR prefix length, and this tool does the binary math to give you everything about that subnet: network address, broadcast address, usable host range, subnet mask, wildcard mask, IP class, and bit count. It also shows a preview of the first and last usable host addresses, and the correct CIDR notation for use in firewall rules or routing configs.
How to use it
- Type an IPv4 address (e.g.
10.0.4.0) in the IP field. It doesn't have to be the network address — enter any IP in the subnet and the tool figures out the network address for you. - Set the CIDR prefix — the number after the slash. Common ones:
/24for a 254-host subnet,/16for 65,534 hosts,/30for a 2-host point-to-point link. - Click Calculate or press Ctrl+Enter.
- Copy the CIDR notation output directly into your firewall rules, security group settings, or routing table.
Reading the results
- Network Address — the base address of the subnet, with all host bits zeroed. This is what you use in routing tables and ACLs to refer to the whole subnet.
- Broadcast Address — the last address in the subnet, with all host bits set to 1. Packets to this address go to every host in the subnet. Never assigned to a device.
- Usable Hosts — total minus 2 (network and broadcast). A /24 gives 256 total, 254 usable. A /30 gives 4 total, 2 usable — the minimum for a point-to-point link.
- Wildcard Mask — the inverse of the subnet mask. Used in ACLs on Cisco IOS and in OSPF area statements. For a /24, the wildcard is
0.0.0.255. - Binary Mask — the subnet mask in binary, split into octets. Useful for understanding exactly which bits are network bits vs host bits.
Frequently Asked Questions
What does CIDR notation mean?
CIDR stands for Classless Inter-Domain Routing. The notation 192.168.1.0/24 means the first 24 bits are the network portion, leaving 8 bits for hosts. That gives 28 = 256 addresses, minus 2 reserved = 254 usable. The prefix length directly tells you the subnet mask: /24 = 255.255.255.0, /16 = 255.255.0.0, /8 = 255.0.0.0.
How is the usable host count calculated?
The formula is 2(32 − prefix) − 2. The −2 removes the network address and broadcast address. Exception: /31 subnets (used for point-to-point links per RFC 3021) don't subtract 2, and /32 is a host route addressing a single device. So a /29 gives 23 − 2 = 6 usable hosts, perfect for a small server cluster or management segment.
What are the private IP address ranges?
Three ranges are reserved for private use and not routable on the public internet: 10.0.0.0/8 (Class A, 16M addresses), 172.16.0.0/12 (Class B, 1M addresses), and 192.168.0.0/16 (Class C, 65K addresses). These are used internally — home networks, corporate LANs, cloud VPCs — and devices reach the internet through NAT.
Can I use any IP address, or does it need to be the network address?
You can use any IP in the subnet. If you enter 192.168.1.75/24, the tool calculates that the network address is 192.168.1.0 and shows results for the full /24 subnet. This is useful when you're handed a host IP and need to know which subnet it belongs to without doing the binary math yourself.
Want the full explanation? Read the guide: Subnetting Without the Headaches: A Practical Guide →