IPv4 CIDR Subnet Calculator
Enter an IPv4 address and a CIDR prefix (or subnet mask) to calculate network details instantly.
What Is CIDR and Why It Matters
CIDR stands for Classless Inter-Domain Routing. It replaced the old class-based IPv4 model (Class A, B, and C) with a more flexible way to allocate IP address space. Instead of saying โthis network must be a Class C,โ CIDR lets you define exactly how many bits belong to the network portion by using a prefix such as /24, /27, or /30.
A CIDR suffix is directly tied to a subnet mask. For example, /24 means 24 bits are used for the network and 8 bits remain for hosts, which corresponds to 255.255.255.0. Understanding this relationship is essential for network design, VLAN planning, firewall rules, cloud network setup, and troubleshooting address conflicts.
How to Use This CIDR Subnet Mask Calculator
Step 1: Enter an IPv4 Address
Type any valid IPv4 address such as 10.0.4.18 or 172.16.22.190.
Step 2: Enter a Prefix or Mask
You can provide either format:
- CIDR notation: /26, 24, /30
- Subnet mask: 255.255.255.192, 255.255.255.0
Step 3: Click Calculate
The tool returns network address, broadcast address, wildcard mask, host range, total addresses, usable hosts, and binary values for quick verification.
What the Results Mean
- Network Address: The first address in the subnet (identifier for the subnet itself).
- Broadcast Address: The last address in the subnet (used to reach all hosts in that subnet, except /31 and /32 special cases).
- First/Last Usable Host: The host range available for devices.
- Total Addresses: All addresses in the subnet, including network and broadcast where applicable.
- Usable Hosts: Normally total minus 2, except for /31 and /32.
- Wildcard Mask: Inverse of subnet mask, often used in ACLs.
CIDR to Subnet Mask Quick Reference
- /8 = 255.0.0.0
- /16 = 255.255.0.0
- /24 = 255.255.255.0
- /25 = 255.255.255.128
- /26 = 255.255.255.192
- /27 = 255.255.255.224
- /28 = 255.255.255.240
- /29 = 255.255.255.248
- /30 = 255.255.255.252
- /31 = 255.255.255.254
- /32 = 255.255.255.255
Real-World Examples
Example 1: Office LAN
If your network is 192.168.10.42/24, the subnet mask is 255.255.255.0. The network is 192.168.10.0 and broadcast is 192.168.10.255. Usable hosts run from 192.168.10.1 to 192.168.10.254.
Example 2: Smaller VLAN
For 192.168.50.99/27, each subnet has 32 total addresses and 30 usable hosts. This is common when segmenting departments or device groups.
Example 3: Point-to-Point WAN Link
A /31 subnet is often used for router-to-router links. In this case, both addresses are usable, improving address efficiency.
Common Subnetting Mistakes to Avoid
- Using non-contiguous subnet masks (invalid in normal IPv4 routing).
- Assigning network or broadcast addresses to hosts on traditional subnets.
- Forgetting that /31 and /32 behave differently from larger subnets.
- Mixing private and public address planning without NAT strategy.
FAQ
Is this calculator for IPv4 or IPv6?
This page is designed for IPv4 CIDR and subnet mask calculations.
Can I enter a subnet mask instead of /prefix?
Yes. You can enter either style, such as /24 or 255.255.255.0.
Why is /31 showing two usable addresses?
Per RFC 3021, /31 is valid for point-to-point links and treats both addresses as usable.
Final Thoughts
CIDR subnetting is one of the most practical networking skills you can learn. Whether you are configuring home labs, enterprise VLANs, cloud VPCs, or firewall ACLs, a reliable CIDR subnet mask calculator saves time and reduces mistakes. Use this tool to validate your plans before deployment and to troubleshoot faster when things go wrong.