Subnet Calculator
IPv4 Subnet Calculator
Enter IP/CIDR to calculate network address, broadcast address, usable address range, and subnet mask in real-time.
Calculation Result
Subnetting is one of the most fundamental yet error-prone calculation tasks for network engineers — you need to simultaneously derive subnet mask, network address, broadcast address, usable host range and block size from a CIDR notation (e.g. 192.168.1.0/24). Manual calculation involves binary bitwise operations, making it easy to make mistakes at mask bit counts and address boundaries. This tool performs all computations locally in your browser; enter any CIDR to get complete subnet parameters in seconds, suitable for network planning, device configuration, ACL rule writing and network certification study (CCNA/HCIA/Network+).
Related
Use Cases
- When planning office or IDC room networks, calculate usable host counts and address ranges for different CIDR prefixes before finalizing VLAN and subnet plans
- When configuring router or switch interfaces, verify subnet mask and network address correctness to avoid outages from mask misconfiguration
- When writing firewall rules or ACLs, use wildcard mask results to quickly configure access control lists on Cisco/H3C devices
- When troubleshooting IP conflicts or connectivity issues, confirm network address and broadcast address boundaries are correct for given IP and mask
- When studying for CCNA/HCIA certifications, use this tool to verify manual calculations and deepen understanding of CIDR, VLSM and subnetting principles
How to Use
- Enter a CIDR-format IPv4 address in the input box (e.g. 192.168.0.1/24); default example is 192.168.0.1/24
- Tool calculates automatically in real-time; no button click needed. Results appear immediately when input format is correct
- View 8 calculation results: Network, Broadcast, Netmask, Wildcard, First Host, Last Host, Block Size, Binary Mask
- Click "Copy JSON Result" to copy complete calculation results to clipboard for network documentation or configuration records
Features
- One-click CIDR calculation: Enter IPv4 address + CIDR prefix (e.g. 192.168.1.0/24) to auto-calculate all subnet parameters, no lookup tables needed
- Eight complete results: Network address, broadcast address, subnet mask, wildcard mask, first host, last host, block size, binary mask
- Pure frontend local calculation: All computation done locally in browser, no data sent to server, instant input response with no latency
- One-click JSON copy: Results can be copied as JSON format for pasting into network design docs, scripts or reports
- Real-time input response: Calculates as you type, supports CIDR prefixes /8 to /32 full range; auto-hides results on format errors
FAQ
What results can the subnet calculator compute?
<p>Enter a CIDR-format IPv4 address (e.g. 192.168.1.0/24), and the tool calculates 8 results in real-time: Network address, Broadcast address, Netmask (subnet mask), Wildcard mask, First Host, Last Host, Block Size (total addresses), and Binary Mask.</p>
Why can't network address and broadcast address be used?
<p>The network address (host bits all 0) identifies the subnet itself as destination network in routing tables; broadcast address (host bits all 1) sends broadcasts to all hosts. Both have special purposes; assigning to hosts causes IP stack anomalies, hence usable hosts = total - 2.</p>
Where is Wildcard Mask used?
<p>Mainly in ACL (Access Control List) and routing protocol (OSPF/EIGRP) configurations on Cisco/H3C devices. Unlike subnet masks, 0 means "must match" and 1 means "ignore". E.g., 0.0.0.255 matches only the first 24 bits (/24 network).</p>
Are calculation results uploaded to a server?
<p>No. All subnet calculations are done entirely locally in the browser via JavaScript; no data is sent to any server. Instant response with no network latency and no privacy risks.</p>
Why doesn't a /31 subnet have 0 usable hosts?
<p>A /31 subnet has only 2 addresses (block size=2), typically used for point-to-point links per RFC 3021 (no network/broadcast needed). Most scenarios use /30 for P2P links.</p>
Does the entered IP have to be a network address?
<p>No. Enter any IP within the subnet (e.g. 192.168.1.100/24); the tool auto-calculates correct network address (192.168.1.0) and all parameters.</p>
How to quickly determine if two IPs are in the same subnet?
<p>Perform bitwise AND on each IP with subnet mask; if results (network addresses) match, same subnet. E.g., 192.168.1.100/24 and 192.168.1.200/24 both yield 192.168.1.0.</p>
Glossary
- CIDR (Classless Inter-Domain Routing)
- Notation using /prefix length to indicate the number of network bits, e.g. /24 means first 24 bits are network bits, replacing traditional Class A/B/C fixed divisions.
- Subnet Mask
- A 32-bit binary number where network bits are 1 and host bits are 0; bitwise AND with IP address yields the network address. E.g. /24 corresponds to 255.255.255.0.
- Network Address
- The first address of a subnet, with host bits all 0; used to identify the subnet itself and cannot be assigned to hosts.
- Broadcast Address
- The last address of a subnet, with host bits all 1; used to send broadcast packets to all hosts in the subnet and cannot be assigned to hosts.
- Wildcard Mask
- Result of bitwise inversion of subnet mask; 0 means must match, 1 means ignore; used in Cisco ACL and routing protocol configuration, e.g. 0.0.0.255.
- VLSM (Variable Length Subnet Mask)
- Using different length subnet masks within the same network to subnet on demand, improving IP address utilization.
- Block Size
- Total number of IP addresses in a subnet (including network and broadcast addresses), calculated as 2^(32-prefix length). E.g. /24 block size is 256.
- Usable Hosts
- Number of IPs assignable to end devices, equal to block size - 2 (subtracting network and broadcast addresses). /31 and /32 are special cases.
- Prefix Length
- The number after / in CIDR notation, indicating the number of network bits. Ranges from /0 (entire Internet) to /32 (single host).
- Default Gateway
- The IP address of the router interface in the subnet, usually the first usable host address, used to forward packets for cross-subnet communication.
CIDR Prefix to Subnet Mask / Usable Hosts Quick Reference
/8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | Traditional Class A network |
/16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Traditional Class B network |
/20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | Medium organization / Cloud VPC |
/22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | Large office network |
/24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Most common subnet / Home / Small office |
/25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | Split /24 into two subnets |
/26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Small department network |
/27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Small office / VLAN segmentation |
/28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Router point-to-point / Data center |
/29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Smallest usable host subnet |
/30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Point-to-point link (router interconnection) |
/32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Single host / Loopback / Firewall rule |
Private IP Address Ranges and Default Subnetting
10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | Class A Private | Large enterprise intranet / Cloud VPC large segments |
172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | Class B Private | Medium enterprise / Docker default network (172.17.0.0/16) |
192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 | Class C Private | Home router / Small office most commonly used |
169.254.0.0 – 169.254.255.255 | 169.254.0.0/16 | 65,536 | Link-Local | Auto-configuration when DHCP fails (APIPA) |
127.0.0.0 – 127.255.255.255 | 127.0.0.0/8 | 16,777,216 | Loopback | Local loopback testing, does not leave network card |
Authoritative References
- Authentication Header Generator
- Cache-Control Parser
- Content-Disposition Parser
- CORS Header Generator
- CORS Inspector
- CSP Generator
- cURL to Code Generator
- DNS Propagation Checker
- DNS Lookup
- Forwarded Header Parser
- Hreflang Tag Generator
- HSTS Analyzer
- HTTP Cookie Parser
- HTTP Headers Checker
- HTTP Request Tester
- HTTP Status Codes Lookup
- IP Lookup
- IPv4 Converter
- IPv4 Range Expander
- IPv6 Toolbox
- Link Header Parser
- MX Lookup
- Port Checker
- URL Parameter Builder
- Rate Limit Header Parser
- Redirect Chain Checker
- Robots.txt Generator
- Robots.txt Checker
- Security Headers Checker
- Security.txt Generator
- Set-Cookie Parser
- Site Network Audit
- Sitemap Generator
- Sitemap Inspector
- SSL Certificate Checker
- Subnet Calculator
- URL Parser
- User-Agent Parser
- UTM Link Generator
- WebSocket Tester
- What Is My IP?
- WHOIS Lookup