CIDR Calculator
Convert between CIDR notation and IPv4 address ranges instantly. Compute subnet masks, network prefixes, wildcard masks, and usable host counts from any CIDR block with interactive charts and binary breakdowns.
About This Calculator
The CIDR Calculator (Classless Inter-Domain Routing Calculator) converts between CIDR notation and IPv4 address ranges, computes subnet masks, network prefixes, wildcard masks, and determines the exact range of IP addresses within any network block. Whether you are a network engineer planning VPC subnets on AWS or Azure, a student learning IP subnetting, or an IT professional configuring firewall rules, this tool provides instant, accurate results.
CIDR, introduced in 1993 (RFC 1517-1520), replaced the rigid classful IP addressing system (Class A, B, C) with a flexible prefix-length notation. Instead of being limited to 8, 16, or 24-bit network boundaries, CIDR allows any prefix length from 0 to 32. This calculator uses bitwise operations: the subnet mask is computed from the prefix length (e.g. /24 produces 255.255.255.0), the network prefix is derived by ANDing the IP with the mask, and the IP range spans from all-0 wildcard bits to all-1 wildcard bits.
In the CIDR to IPv4 Range mode, enter an IP address and a subnet mask width to compute: the dotted-decimal subnet mask, the network prefix (subnetwork identifier), the wildcard mask (inverse of the subnet mask), the first (network) and last (broadcast) IP addresses, the total number of IP addresses, and the number of usable host addresses. In the IPv4 Range to CIDR mode, enter a start and end IP to discover the CIDR block(s) that cover that range — the calculator finds the largest power-of-2-aligned block starting at the range's beginning, subtracts it, and recurses for any remainder.
Regional Notes
CIDR notation and IPv4 subnetting are universal networking standards defined in the IETF RFCs (1517-1520). The calculations are purely mathematical and independent of geographic region, currency, or locale. Network engineers in India, the United States, the United Kingdom, and everywhere else use identical CIDR notation and subnet masks. This calculator works the same way globally.
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation is a compact way of representing an IP address and its subnet mask. It consists of an IP address followed by a slash and a number between 0 and 32 (e.g. 192.168.1.0/24), where the number indicates how many consecutive 1-bits make up the subnet mask.
How do I convert a CIDR block to an IP range?
To convert a CIDR block like 192.168.1.0/24 to an IP range: (1) compute the subnet mask from the prefix length (e.g. /24 = 255.255.255.0), (2) apply the mask to the IP using bitwise AND to find the network prefix, (3) all bits not covered by the mask (wildcard bits) range from all 0s (first IP) to all 1s (last IP). For /24, the range is 192.168.1.0 to 192.168.1.255.
What is a subnet mask?
A subnet mask is a 32-bit number that separates an IP address into network and host portions. Bits set to 1 represent the network portion, while bits set to 0 represent the host portion. For example, 255.255.255.0 (binary: 24 ones followed by 8 zeros) means the first 24 bits identify the network and the last 8 bits identify individual hosts within that network.
How many usable hosts does a /24 subnet have?
A /24 subnet provides 256 total IP addresses (2^8), of which 254 are usable for hosts. The first address is reserved as the network address and the last address is reserved as the broadcast address. For /31 subnets, both addresses are usable (no broadcast), and /32 represents a single host with no subnet.
How do I find the CIDR notation from an IP range?
To find the CIDR notation from an IP range, the calculator uses an algorithm that finds the largest power-of-2-aligned block that fits entirely within the range, subtracts it, and repeats with the remainder. A range that starts at a power-of-2 boundary (like 10.0.0.0 to 10.0.0.31) produces a single CIDR block (10.0.0.0/27), while arbitrary ranges may require multiple blocks.
What are wildcard bits in a subnet?
Wildcard bits are the bit positions in the subnet mask that are set to 0 (the host portion). They represent the bits that can be freely varied to form different IP addresses within the same subnetwork. The wildcard mask is the bitwise NOT of the subnet mask. For example, with a /24 subnet mask (255.255.255.0), the wildcard mask is 0.0.0.255.
What is the difference between network address and broadcast address?
The network address (first IP) has all host bits set to 0 and identifies the subnetwork itself. The broadcast address (last IP) has all host bits set to 1 and is used to send data to all devices on the subnetwork simultaneously. Neither address can be assigned to a host device, which is why the usable host count is total IPs minus 2 for subnets larger than /31.
Is CIDR still used today?
Yes, CIDR is the fundamental addressing scheme of the modern internet. It replaced the classful network architecture (Class A, B, C) in 1993 and is used for IP address allocation, BGP routing table aggregation, VPC subnet design in cloud computing (AWS, Azure, GCP), and all modern network configuration. Without CIDR, the IPv4 address space would have been exhausted much earlier.