IPv4 IP Address to CIDR Calculator
Enter an IPv4 address and either a subnet mask or prefix length. The tool converts the input into CIDR notation and shows subnet details.
What is CIDR and why does it matter?
CIDR stands for Classless Inter-Domain Routing. It is the modern standard for expressing network ranges, replacing older class-based networking (Class A/B/C). Instead of relying on fixed boundaries, CIDR lets you define network size using a prefix such as /24, /27, or /19. This provides far more flexibility in subnet planning and IP utilization.
When people search for an IP address to CIDR calculator, they are usually trying to convert values like 192.168.10.15 + 255.255.255.0 into 192.168.10.15/24 (or network form 192.168.10.0/24), and then determine the broadcast address and host range.
How to use this calculator
- Enter a valid IPv4 address (for example, 10.0.12.44).
- Enter either a dotted subnet mask (255.255.252.0) or a prefix length (22).
- Click Calculate CIDR.
- Review the output: CIDR notation, network, broadcast, wildcard, and host capacity.
How IP to CIDR conversion works
1) Convert subnet mask to prefix length
A mask like 255.255.255.0 has 24 leading 1-bits in binary form, so the prefix is /24. A mask of 255.255.255.192 has 26 leading ones, so it becomes /26.
2) Calculate network address
The network address is the result of a bitwise AND between the IP address and subnet mask. This clears host bits and keeps network bits.
3) Calculate broadcast address
The broadcast address is the highest IP in the subnet, where all host bits are set to 1.
4) Determine host range and counts
For most subnets, usable hosts are from network + 1 to broadcast - 1. Total hosts are 2^(32 - prefix). Usable hosts are usually total minus 2 (except /31 and /32 special cases).
Common subnet masks and CIDR prefixes
- 255.0.0.0 = /8
- 255.255.0.0 = /16
- 255.255.255.0 = /24
- 255.255.255.128 = /25
- 255.255.255.192 = /26
- 255.255.255.224 = /27
- 255.255.255.240 = /28
- 255.255.255.248 = /29
- 255.255.255.252 = /30
Practical example
Suppose you have IP 172.16.5.130 and mask 255.255.255.192.
- Mask converts to /26
- CIDR notation: 172.16.5.130/26
- Network: 172.16.5.128
- Broadcast: 172.16.5.191
- Usable range: 172.16.5.129 - 172.16.5.190
Common mistakes to avoid
- Using non-contiguous subnet masks (example: 255.0.255.0 is invalid).
- Confusing host IP/CIDR with network CIDR.
- Forgetting that /31 and /32 behave differently from normal host ranges.
- Entering private addresses when you actually need public allocation planning.
Final thoughts
Whether you are configuring routers, cloud VPCs, VLANs, firewall rules, or home labs, understanding CIDR is essential. A reliable IP address to CIDR calculator saves time and helps prevent costly subnetting errors. Bookmark this page whenever you need quick IPv4 conversion and subnet details.