CIDR Calculator
A CIDR calculator turns an IP address and prefix length into every subnet detail a network engineer, sysadmin or student needs when planning or troubleshooting IPv4 networks. CIDR (Classless Inter-Domain Routing) notation, written as an address, a slash, and a number such as 192.168.1.0/24, tells you how many of the 32 bits in an IPv4 address are reserved for the network portion, leaving the rest for individual hosts. Enter an IPv4 address and choose a prefix length from /8 to /32, or type a complete CIDR block such as 10.0.0.0/24 directly and the fields fill in automatically. You can also pick from common presets, including the three RFC 1918 private address ranges and the AWS default VPC block. The calculator instantly returns the network address, broadcast address, subnet mask, wildcard mask, total address count, usable host range, and the first and last usable host addresses, alongside a binary breakdown of the address and mask and a reference table covering every standard prefix from /8 to /32 with its host count. Use it to work out how many devices a subnet can hold before you provision it, to convert between CIDR notation and dotted-decimal subnet masks for router or firewall configuration, or to see how a network splits into smaller subnets. All figures use standard IPv4 bitwise arithmetic, so results are exact rather than estimated.
1. IP Address
2. Or Enter CIDR Block
Type a CIDR block above to auto-fill the IP and prefix fields, or use the fields on the left directly.
Subnet Details
Binary Representation
----Network bits are fixed (shown by the mask). Host bits vary to form individual addresses within the subnet.
The first 24 bits are the network portion. The remaining 8 bits form the host address space (256 addresses total).
Common Prefix Reference
| Prefix | Subnet Mask | Total Addresses | Usable Hosts | Class Equiv. |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Class A |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Class B |
| /24 | 255.255.255.0 | 256 | 254 | Class C |
| /25 | 255.255.255.128 | 128 | 126 | Half C |
| /26 | 255.255.255.192 | 64 | 62 | Quarter C |
| /27 | 255.255.255.224 | 32 | 30 | Eighth C |
| /28 | 255.255.255.240 | 16 | 14 | Sixteenth C |
| /29 | 255.255.255.248 | 8 | 6 | 1/32 C |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | P2P only |
| /32 | 255.255.255.255 | 1 | 1 (host route) | Single host |
How CIDR Works
CIDR (Classless Inter-Domain Routing) notation expresses an IPv4 address and its network prefix as a single string: the address, a slash, and the prefix length. The prefix length specifies how many of the 32 bits in the address identify the network. The remaining bits identify individual hosts within that network.
For example, 192.168.1.0/24 means the first 24 bits (192.168.1) are the network portion and the last 8 bits are the host portion. This gives 2^8 = 256 total addresses, of which 254 are usable (the network address 192.168.1.0 and broadcast address 192.168.1.255 are reserved).
Formulas Used
Given an IP address and prefix length n:
- Total addresses: 2^(32 - n)
- Subnet mask: 32 bits with the first n set to 1, the rest 0. Written as four decimal octets.
- Wildcard mask: Bitwise inverse of the subnet mask (0s and 1s swapped).
- Network address: IP address AND subnet mask (bitwise AND).
- Broadcast address: Network address OR wildcard mask (bitwise OR).
- First usable host: Network address + 1 (not applicable for /31 or /32).
- Last usable host: Broadcast address - 1 (not applicable for /31 or /32).
- Usable hosts: 2^(32 - n) - 2. For /31: 2 (per RFC 3021). For /32: 1 (single host route).
Worked Example: 192.168.1.0/24
With IP 192.168.1.0 and prefix /24:
| Field | Value |
|---|---|
| Subnet mask | 255.255.255.0 |
| Wildcard mask | 0.0.0.255 |
| Network address | 192.168.1.0 |
| Broadcast address | 192.168.1.255 |
| First usable host | 192.168.1.1 |
| Last usable host | 192.168.1.254 |
| Total addresses | 256 (2^8) |
| Usable hosts | 254 |
The calculator above shows exactly these values when you use the default inputs.
Private IP Address Ranges (RFC 1918)
Three IPv4 address ranges are reserved for private use and are not routed on the public internet:
- 10.0.0.0/8: 10.0.0.0 to 10.255.255.255 (16,777,216 addresses)
- 172.16.0.0/12: 172.16.0.0 to 172.31.255.255 (1,048,576 addresses)
- 192.168.0.0/16: 192.168.0.0 to 192.168.255.255 (65,536 addresses)
Most home and office networks use addresses from these ranges. Network address translation (NAT) maps private addresses to one or more public IP addresses for internet access.
Subnetting: Splitting a Block
You can divide any CIDR block into smaller subnets by increasing the prefix length. Each additional bit doubles the number of subnets and halves the number of hosts per subnet. For example, a single /24 (256 addresses) can be split into two /25 subnets (128 addresses each), four /26 subnets (64 addresses each), and so on. This is used in network design to segment traffic, apply different security policies to different parts of a network, and make efficient use of IP address space.
Related Calculators
- Essential Calculators: all computer, digital, and converter tools.
- IP Subnet Calculator (CIDR): detailed subnetting with supernet and subnet split views.
- Bandwidth Calculator: data transfer time and speed.
- Hash Generator (MD5, SHA): generate checksums and hashes from text.
- Base64 Encoder / Decoder: encode or decode Base64 strings.
- JWT Expiry Checker NZ: is a JSON Web Token Expired?
- Lorem Ipsum Bytes Generator NZ: Placeholder Text to a Byte Size.
Sources / method: RFC 4632 "Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan". RFC 1918 "Address Allocation for Private Internets". RFC 3021 "Using 31-Bit Prefixes on IPv4 Point-to-Point Links". All arithmetic is standard IPv4 bitwise operations.
This calculator covers IPv4 addresses only. IPv6 uses 128-bit addresses and different notation conventions. Results are mathematically exact for the inputs provided.