Subnet Calculator
Free subnet calculator - get network address, broadcast address, usable host range, wildcard mask, and IP class from any CIDR or subnet mask.
About Subnet Calculator
This subnet calculator takes an IP address and subnet mask (in CIDR or dotted-decimal notation) and computes all the essential network details you need for network planning, troubleshooting, and configuration.
Comprehensive Results
Enter an IP address with a CIDR prefix (like 192.168.1.0/24) or with a dotted-decimal subnet mask, and the calculator instantly displays the network address, broadcast address, first and last usable hosts, number of usable hosts, wildcard mask, and IP class.
Dual Input Modes
You can enter the subnet information in CIDR notation (e.g., /24) or as a dotted-decimal subnet mask (e.g., 255.255.255.0). The calculator validates your input and provides helpful error messages if the format is incorrect.
Binary Representation
The calculator shows the binary representation of both the IP address and subnet mask, making it easy to visualize the network and host portions. This is particularly helpful for learning networking concepts or verifying subnetting by hand.
Common Uses
- Planning network address allocation and subnetting schemes
- Verifying subnet configurations on routers and switches
- Studying for networking certifications like CCNA or CompTIA Network+
- Troubleshooting connectivity issues related to incorrect subnetting
- Calculating usable host ranges for DHCP pool configuration
The binary view pairs well with the binary to decimal converter if you need to convert individual octets. All calculations are performed locally in your browser, and no IP addresses or network data are transmitted anywhere.
Frequently Asked Questions
What is CIDR notation and how do I use it?
CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length, written as IP/prefix (e.g., 192.168.1.0/24). The prefix number indicates how many bits of the address represent the network portion. A /24 means the first 24 bits are the network, leaving 8 bits for host addresses, which gives 254 usable hosts.
How do I determine the number of usable hosts in a subnet?
The formula is 2^(32 - prefix length) - 2. The subtraction of 2 accounts for the network address and broadcast address, which cannot be assigned to hosts. For example, a /24 subnet has 2^8 - 2 = 254 usable hosts, while a /30 has 2^2 - 2 = 2 usable hosts.
What is a wildcard mask and when is it used?
A wildcard mask is the inverse of a subnet mask. Where the subnet mask has a 1-bit, the wildcard mask has a 0-bit, and vice versa. For example, the wildcard mask for 255.255.255.0 is 0.0.0.255. Wildcard masks are commonly used in access control lists (ACLs) on Cisco routers and in OSPF configurations.
What are IP address classes and do they still matter?
IP address classes (A, B, C, D, E) were the original method for allocating address ranges. Class A covers 1.0.0.0 to 126.255.255.255, Class B covers 128.0.0.0 to 191.255.255.255, and Class C covers 192.0.0.0 to 223.255.255.255. While CIDR has largely replaced classful networking, understanding classes remains useful for quickly identifying address ranges and for networking exams.