CIDR Calculator
Convert CIDR notation to subnet mask, network address, broadcast address, and usable host range. Enter any IPv4 address and prefix length (e.g. /24) to get instant results. Free, runs in your browser.
CIDR Calculator
Enter an IPv4 address and prefix length (e.g. 192.168.1.0/24). You can also paste CIDR notation into the IP field. Results update as you type.
Result
| Network | 192.168.1.0 |
|---|---|
| Broadcast | 192.168.1.255 |
| Subnet mask | 255.255.255.0 |
| Wildcard | 0.0.0.255 |
| First host | 192.168.1.1 |
| Last host | 192.168.1.254 |
| Usable hosts | 254 |
What Is CIDR?
CIDR (Classless Inter-Domain Routing) is a way to write an IP address and its associated routing prefix in one compact form. Instead of specifying a subnet mask like 255.255.255.0, you write a slash followed by the number of bits used for the network part — for example, 192.168.1.0/24. The number after the slash is the prefix length: how many bits (from the left) define the network. The remaining bits define hosts within that network.
CIDR replaced the older classful addressing (Class A, B, C). It allows flexible subnet sizes and efficient allocation of IP space. When you design networks, set up firewalls, or configure cloud VPCs, you constantly work with CIDR blocks. Our subnet calculator and IP range calculator help you convert between CIDR, subnet mask, and actual IP ranges. For checking whether an address is valid before calculating, use our IP address validator.
How CIDR Notation Works
In 192.168.1.0/24, the /24 means the first 24 bits are fixed as the network identifier. An IPv4 address has 32 bits total, so 24 bits for network leaves 8 bits for hosts. Two to the power of 8 is 256 addresses; subtract the network and broadcast addresses and you get 254 usable host addresses. A /16 gives 65,536 addresses (65,534 usable); a /28 gives 16 addresses (14 usable). The smaller the number after the slash, the larger the block.
Converting from subnet mask to CIDR is simple: count the consecutive 1 bits in the mask. 255.255.255.0 in binary is 24 ones followed by 8 zeros, so the CIDR is /24. Our wildcard mask calculator inverts the subnet mask for ACLs; the network address calculator and broadcast address calculator give you the first and last addresses of the block.
Why Use a CIDR Calculator
Network engineers use CIDR calculators to plan subnets, check firewall rules, and understand cloud provider offerings (e.g. AWS VPC CIDR blocks). Developers use them to validate allowed IP ranges in configs or to split a large block into smaller subnets. Security teams use them to map which addresses belong to a given prefix. A CIDR calculator saves time and reduces errors compared to doing bitwise math by hand.
This calculator runs in your browser: enter any IPv4 address and a CIDR prefix (0–32), and you get the subnet mask, wildcard mask, network address, broadcast address, first and last host, and usable host count. For listing every IP in a range, use the IP range generator. For IPv6, use our IPv6 subnet calculator. To see if an IP is private or public, try the private vs public IP checker.
CIDR and Real-World Use
Cloud platforms (AWS, GCP, Azure) and on-prem networks rely on CIDR for defining subnets and security groups. Knowing the exact range of a /24 or /28 helps you write accurate firewall rules and avoid overlapping ranges when connecting networks. Pair a CIDR calculator with our IP lookup to see geolocation of an IP, or with ping test and traceroute to test connectivity to hosts in a subnet.
FAQs
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation expresses an IP address and its routing prefix as one value, e.g. 192.168.1.0/24. The number after the slash is the prefix length in bits.
What does /24 mean in CIDR?
/24 means the first 24 bits are the network portion, leaving 8 bits for hosts. That gives 256 addresses (254 usable hosts) in the subnet.
Is the CIDR calculator free?
Yes. Our CIDR calculator runs in your browser. No signup, no data sent to any server.
How do I convert subnet mask to CIDR?
Count the number of consecutive 1 bits in the subnet mask. For 255.255.255.0 that is 24, so the CIDR is /24.
Does CIDR work for IPv6?
Yes. IPv6 uses CIDR the same way (e.g. 2001:db8::/32). Our IPv6 subnet calculator supports IPv6 prefixes.