Features
CIDR notation calculator
Subnet mask converter
Network address calculation
Broadcast address calculation
Usable host range
Total hosts calculation
Wildcard mask
Binary representation
100% client-side calculation
IPv4 support
What is IP Subnetting?
IP subnetting is the practice of dividing a network into smaller sub-networks (subnets). This improves network performance, security, and management by organizing IP addresses into logical groups. Subnetting uses subnet masks to determine which portion of an IP address represents the network and which represents the host.
CIDR (Classless Inter-Domain Routing) notation provides a compact way to specify IP addresses and their routing prefix. For example, 192.168.1.0/24 means the first 24 bits are the network portion, leaving 8 bits for hosts (256 addresses, 254 usable).
Key Subnetting Concepts
- Network Address: First IP in subnet, identifies the network
- Broadcast Address: Last IP in subnet, sends to all hosts
- Usable Hosts: IPs between network and broadcast addresses
- Subnet Mask: Defines network and host portions
- CIDR Notation: Compact format (e.g., /24 = 255.255.255.0)
- Wildcard Mask: Inverse of subnet mask, used in ACLs
Example: 192.168.1.0/24
- Network Address: 192.168.1.0
- Broadcast Address: 192.168.1.255
- Usable Range: 192.168.1.1 - 192.168.1.254
- Total Hosts: 256 (254 usable)
- Subnet Mask: 255.255.255.0
How to Use the IP Subnet Calculator
Step 1: Enter IP Address
Input any IP address within the subnet you want to calculate. The calculator works with any IP in the range, not just the network address. For example, 192.168.1.50 with /24 gives the same subnet as 192.168.1.0/24.
Step 2: Specify Subnet
Enter either CIDR notation (e.g., 24) or subnet mask (e.g., 255.255.255.0). The calculator accepts both formats and converts between them automatically.
Step 3: Review Results
The calculator displays network address, broadcast address, usable host range, total hosts, and other subnet details. Use this information for network planning, configuration, or troubleshooting.
Understanding the Output
Network address is used in routing tables. Broadcast address sends packets to all hosts. Usable hosts are IPs you can assign to devices. The first and last IPs (network and broadcast) cannot be assigned to hosts.
Common Use Cases
1. Network Planning
Calculate how many hosts a subnet can support before implementing a network. Determine if you need to split a network into smaller subnets or combine subnets for more hosts.
2. IP Address Assignment
Find the usable IP range for assigning addresses to devices. Ensure you don't accidentally use the network or broadcast address, which would cause connectivity issues.
3. Router Configuration
Configure router interfaces with correct network addresses and subnet masks. Verify that subnets don't overlap and routing is configured properly.
4. Firewall Rules
Create firewall rules using CIDR notation to allow or block entire subnets. Calculate wildcard masks for ACLs (Access Control Lists) on Cisco devices.
5. Cloud Infrastructure
Plan VPC (Virtual Private Cloud) subnets in AWS, Azure, or GCP. Calculate subnet sizes for different tiers (web, app, database) ensuring no IP conflicts.
Subnet Calculation Examples
Example 1: /24 Network (Class C)
IP: 192.168.1.0/24
Subnet Mask: 255.255.255.0
Network: 192.168.1.0
Broadcast: 192.168.1.255
Usable Range: 192.168.1.1 - 192.168.1.254
Total Hosts: 256 (254 usable)
Example 2: /16 Network (Class B)
IP: 172.16.0.0/16
Subnet Mask: 255.255.0.0
Network: 172.16.0.0
Broadcast: 172.16.255.255
Usable Range: 172.16.0.1 - 172.16.255.254
Total Hosts: 65,536 (65,534 usable)
Example 3: /28 Network (Small Subnet)
IP: 10.0.0.16/28
Subnet Mask: 255.255.255.240
Network: 10.0.0.16
Broadcast: 10.0.0.31
Usable Range: 10.0.0.17 - 10.0.0.30
Total Hosts: 16 (14 usable)
Example 4: /30 Network (Point-to-Point)
IP: 10.0.0.0/30
Subnet Mask: 255.255.255.252
Network: 10.0.0.0
Broadcast: 10.0.0.3
Usable Range: 10.0.0.1 - 10.0.0.2
Total Hosts: 4 (2 usable)
Use Case: Router-to-router links
Example 5: /8 Network (Class A)
IP: 10.0.0.0/8
Subnet Mask: 255.0.0.0
Network: 10.0.0.0
Broadcast: 10.255.255.255
Usable Range: 10.0.0.1 - 10.255.255.254
Total Hosts: 16,777,216 (16,777,214 usable)
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation is a compact way to specify IP addresses and routing prefixes. The number after the slash (/) indicates how many bits are used for the network portion. For example, /24 means 24 bits for network, 8 bits for hosts.
How do I convert subnet mask to CIDR?
Count the number of consecutive 1 bits in the binary representation of the subnet mask. For example, 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary, which has 24 ones, so it's /24.
Why can't I use the first and last IP?
The first IP (network address) identifies the network itself and is used in routing tables. The last IP (broadcast address) is reserved for sending packets to all hosts in the subnet. Both are reserved and cannot be assigned to devices.
What's the difference between /24 and /25?
/24 provides 256 total IPs (254 usable), while /25 provides 128 total IPs (126 usable). /25 splits a /24 network in half, useful when you need two smaller subnets instead of one large one.
What is a wildcard mask?
A wildcard mask is the inverse of a subnet mask, used primarily in Cisco ACLs. Where subnet mask has 1s, wildcard has 0s, and vice versa. For example, subnet mask 255.255.255.0 becomes wildcard mask 0.0.0.255.
How many hosts do I need for my network?
Count all devices (computers, servers, printers, IoT devices) plus 20-30% growth buffer. Then choose a subnet size that accommodates this number. Remember, you lose 2 IPs (network and broadcast) from the total.
Can subnets overlap?
No, subnets should never overlap. Overlapping subnets cause routing conflicts and connectivity issues. Use a subnet calculator to ensure your subnets don't overlap when planning network architecture.
What's the smallest usable subnet?
/30 (255.255.255.252) is the smallest practical subnet with 2 usable hosts. It's commonly used for point-to-point links between routers. /31 is special and used only for point-to-point links without broadcast.
How do I subnet a /24 into smaller subnets?
Increase the CIDR number to create smaller subnets. /24 becomes two /25 subnets, four /26 subnets, eight /27 subnets, etc. Each increment doubles the number of subnets and halves the hosts per subnet.
Is this calculator accurate?
Yes, all calculations are performed using standard IP subnetting formulas. The calculator handles all valid IPv4 addresses and CIDR notations from /0 to /32.
Related Tools
Explore our other network tools: