Loading...
Calculate IP subnets with CIDR notation, subnet masks, wildcard masks, and detailed network analysis. Perfect for network engineers and IT professionals.
Enter IP address and subnet information
Subnetting divides a network into smaller sub-networks, improving security and efficiency.
Full support for CIDR notation (/0 to /32) with instant conversion to subnet masks and vice versa.
Toggle between CIDR and subnet mask formats with automatic bidirectional conversion.
View IP addresses and subnet masks in binary format for learning and verification.
Automatic wildcard mask generation for router ACLs and OSPF configuration.
Complete IP range with network, broadcast, first and last usable host addresses.
Automatic detection of IP class (A, B, C) and type (Private, Public, Loopback).
IP subnetting is the process of dividing a large network into smaller, more manageable sub-networks (subnets). This improves network performance, security, and organization by creating logical network segments.
Benefits of Subnetting:
CIDR (Classless Inter-Domain Routing) notation uses a slash followed by a number to indicate the network prefix length. The number represents how many bits are used for the network portion of the address.
Example: 192.168.1.0/24
Rule: Higher CIDR number = smaller subnet, fewer hosts
A subnet mask is a 32-bit number that divides an IP address into network and host portions. In binary, network bits are 1s and host bits are 0s.
255.255.255.0 (/24):
Binary: 11111111.11111111.11111111.00000000
24 network bits, 8 host bits = 254 usable hosts
255.255.255.128 (/25):
Binary: 11111111.11111111.11111111.10000000
25 network bits, 7 host bits = 126 usable hosts
Network Address (First IP):
• All host bits set to 0
• Identifies the network itself
• Cannot be assigned to devices
Example: 192.168.1.0 in 192.168.1.0/24
Broadcast Address (Last IP):
• All host bits set to 1
• Sends messages to all hosts in subnet
• Cannot be assigned to devices
Example: 192.168.1.255 in 192.168.1.0/24
Usable Host Range:
• Between network and broadcast addresses
Example: 192.168.1.1 to 192.168.1.254
Formula:
Usable Hosts = 2^(32 - CIDR) - 2
Subtract 2 for network and broadcast addresses
• /24: 2^8 - 2 = 254 usable hosts
• /25: 2^7 - 2 = 126 usable hosts
• /26: 2^6 - 2 = 62 usable hosts
• /27: 2^5 - 2 = 30 usable hosts
• /28: 2^4 - 2 = 14 usable hosts
• /30: 2^2 - 2 = 2 usable hosts (point-to-point)
Special Cases: /31 (RFC 3021) provides 2 usable IPs for point-to-point links, /32 is a single host.
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts | Typical Use |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | Class A networks |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Class B networks |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Class C, typical LAN |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | Small networks |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Department subnets |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Small office subnets |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Micro subnets |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Very small subnets |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Point-to-point links |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | Point-to-point (RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Single host |
Range: 1.0.0.0 - 126.255.255.255
Default Mask: 255.0.0.0 (/8)
Networks: 126 (1-126)
Hosts per Network: 16,777,214
First Octet: 0xxxxxxx (binary)
Use: Very large organizations, ISPs
Range: 128.0.0.0 - 191.255.255.255
Default Mask: 255.255.0.0 (/16)
Networks: 16,384
Hosts per Network: 65,534
First Octet: 10xxxxxx (binary)
Use: Medium to large organizations
Range: 192.0.0.0 - 223.255.255.255
Default Mask: 255.255.255.0 (/24)
Networks: 2,097,152
Hosts per Network: 254
First Octet: 110xxxxx (binary)
Use: Small networks, home/office LANs
Class D (Multicast): 224.0.0.0 - 239.255.255.255
Class E (Reserved): 240.0.0.0 - 255.255.255.255
Loopback: 127.0.0.0 - 127.255.255.255
Link-Local: 169.254.0.0 - 169.254.255.255
Note: Not used for standard host addressing
Class A Private
10.0.0.0/8
10.0.0.0 - 10.255.255.255
16,777,216 addresses
Class B Private
172.16.0.0/12
172.16.0.0 - 172.31.255.255
1,048,576 addresses
Class C Private
192.168.0.0/16
192.168.0.0 - 192.168.255.255
65,536 addresses
Note: Private IPs are not routable on the public internet and require NAT (Network Address Translation) for internet access.
Network: 192.168.1.0/24
Subnet Mask: 255.255.255.0
Usable Range: 192.168.1.1 - 192.168.1.254
Usable Hosts: 254
Typical Allocation:
Network: 192.168.0.0/22
Subnet Mask: 255.255.252.0
Usable Range: 192.168.0.1 - 192.168.3.254
Usable Hosts: 1,022
Subnet Division:
Network: 10.0.0.0/30
Subnet Mask: 255.255.255.252
Usable Range: 10.0.0.1 - 10.0.0.2
Usable Hosts: 2
Router Connection:
Note: Efficient for router-to-router connections
Base Network: 10.0.0.0/8
Total Addresses: 16,777,216
VLSM Allocation:
Benefit: Hierarchical design with room for growth
A wildcard mask is the inverse of a subnet mask, used primarily in router Access Control Lists (ACLs) and OSPF configuration. It specifies which bits to match (0) and which to ignore (255).
Conversion Formula:
Wildcard Mask = 255.255.255.255 - Subnet Mask
Example 1: Subnet Mask 255.255.255.0
Wildcard: 255.255.255.255 - 255.255.255.0 = 0.0.0.255
Example 2: Subnet Mask 255.255.255.192 (/26)
Wildcard: 255.255.255.255 - 255.255.255.192 = 0.0.0.63
| CIDR | Subnet Mask | Wildcard Mask | Meaning |
|---|---|---|---|
| /24 | 255.255.255.0 | 0.0.0.255 | Match first 3 octets, ignore last |
| /25 | 255.255.255.128 | 0.0.0.127 | Match first 25 bits |
| /26 | 255.255.255.192 | 0.0.0.63 | Match first 26 bits |
| /30 | 255.255.255.252 | 0.0.0.3 | Match first 30 bits |
| /32 | 255.255.255.255 | 0.0.0.0 | Match exact host |
Cisco ACL Examples:
access-list 10 permit 192.168.1.0 0.0.0.255
Permits all hosts in 192.168.1.0/24 network
access-list 10 permit 192.168.1.10 0.0.0.0
Permits only host 192.168.1.10 (exact match)
access-list 10 permit 10.0.0.0 0.255.255.255
Permits entire 10.0.0.0/8 network
access-list 10 permit any
Equivalent to: 0.0.0.0 255.255.255.255 (match all)
To calculate an IP subnet: 1) Enter your IP address (e.g., 192.168.1.1), 2) Specify the subnet using CIDR notation (e.g., /24) or subnet mask (e.g., 255.255.255.0), 3) The calculator determines network address, broadcast address, usable IP range, and total hosts. For example, 192.168.1.0/24 provides 254 usable hosts (192.168.1.1 to 192.168.1.254).
CIDR (Classless Inter-Domain Routing) notation uses a slash followed by a number (e.g., /24) to indicate how many bits are used for the network portion. A /24 means the first 24 bits define the network, leaving 8 bits for hosts (256 total addresses, 254 usable). Common examples: /16 provides 65,536 addresses, /8 provides 16,777,216 addresses. Higher CIDR numbers create smaller subnets with fewer available hosts.
A /24 subnet contains 256 total IP addresses but only 254 usable host addresses. The formula is 2^(32-24) - 2 = 256 - 2 = 254. We subtract 2 because the network address and broadcast address cannot be assigned to hosts. Other common subnet sizes: /25 provides 126 usable hosts, /23 provides 510 hosts, /22 provides 1,022 hosts, and /16 provides 65,534 usable hosts.