Subnet Calculator
Calculate IPv4 subnet details from any IP address and CIDR prefix length. Instantly find the network address, broadcast address, subnet mask, wildcard mask, usable host range, and total host count. Essential for network engineers, system administrators, and IT students configuring routers, firewalls, VLANs, and cloud VPC subnets.
Enter Values
Result
Enter values above and click Calculate to see your result.
AI Assistant
Ask about this calculator
I can help you understand the subnet calculator formula, interpret your results, and answer follow-up questions.
Try asking
Formula
The calculator converts four octets into a 32-bit integer, creates a subnet mask from the CIDR prefix length (the number of leading 1 bits), then applies bitwise AND to find the network address and bitwise OR with the inverted mask to find the broadcast address. Usable hosts are everything between network + 1 and broadcast - 1, following standard RFC conventions. /31 and /32 are handled as special cases.
Worked Example
Frequently Asked Questions
What is a CIDR prefix length?
The CIDR prefix (like /24 or /16) indicates how many of the 32 bits in an IPv4 address are used for the network portion. A /24 means 24 network bits and 8 host bits, giving 256 addresses (254 usable). Common prefixes: /8 (16 million addresses), /16 (65,536), /24 (256), /28 (16), /30 (4), /32 (1).
Why are /31 and /32 handled differently?
/32 is a single host address with no network or broadcast. /31 is a point-to-point link per RFC 3021 with exactly 2 addresses and no traditional broadcast, commonly used for router-to-router connections to save IP space.
Are private IP ranges like 192.168.x.x calculated differently?
No. The same bitwise subnet math applies to all IPv4 addresses. Whether the address is private (10.x.x.x, 172.16-31.x.x, 192.168.x.x) or public only affects routing on the internet, not the subnet calculation itself.
Does this calculator support IPv6?
No. This calculator handles IPv4 (32-bit) addresses only. IPv6 uses 128-bit addresses with hexadecimal notation and requires a different subnet calculator.
What is a wildcard mask?
The wildcard mask is the inverse of the subnet mask (each bit flipped). For a /24 subnet mask 255.255.255.0, the wildcard mask is 0.0.0.255. Wildcard masks are used in Cisco ACLs and OSPF configurations to specify which address bits to match.
AI Assistant
Ask about this calculator
I can help you understand the subnet calculator formula, interpret your results, and answer follow-up questions.
Try asking
Related Calculators
More Maths Calculators
View allAccurate and Reliable
All calculations run locally. Step-by-step solutions you can trust.
Precise Mathematical Calculations Powered by Calculory AI