IP Subnet Calculator (CIDR)
This calculator works out the key details of an IPv4 subnet from an IP address and a CIDR prefix length, the shorthand network engineers use for how many bits of an address are reserved for the network rather than individual hosts. Enter an IPv4 address such as 192.168.1.0, choose a prefix from /0 to /32, or type the full CIDR notation such as 192.168.1.0/24 and it fills in the rest automatically. The calculator returns the subnet mask, network address, broadcast address, wildcard mask, first and last usable host, and the total number of usable hosts in that range. Quick presets cover common private ranges under RFC 1918, and you can split a subnet into 2, 4, 8 or 16 equal sub-subnets to see how the prefix length and host ranges change. A colour-coded binary breakdown shows which bits are fixed for the network and which are free for hosts, handy when learning subnetting or checking a design. Use it to plan IP address allocation for a home network, office LAN or cloud VPC, to confirm a subnet is large enough for the devices you need, or to work out the wildcard mask for a Cisco access control list or OSPF network statement. All results are calculated instantly in your browser using standard binary arithmetic, based on RFC 950 and RFC 4632, and no data is sent to any server.
1. IP Address
2. Quick Presets
Full Subnet Summary
Subnet Division
Select a division above to split this subnet.
IP address: 11000000.10101000.00000001.00000000
Subnet mask: 11111111.11111111.11111111.00000000
Network address: -
Green = network bits (fixed) Amber = host bits (variable)
How IP Subnetting Works
Every IPv4 address is a 32-bit number, written as four octets (groups of 8 bits) separated by dots. The address is split into two parts: the network portion (which identifies the subnet) and the host portion (which identifies individual devices within the subnet). The subnet mask defines where this boundary falls. In CIDR (Classless Inter-Domain Routing) notation, the prefix length after the slash tells you how many bits belong to the network.
Core Formulas
Given an IPv4 address and a prefix length n:
- Subnet mask: the leftmost n bits are all 1s; the remaining (32 - n) bits are all 0s.
- Network address: IP address AND subnet mask (bitwise).
- Broadcast address: network address OR (NOT subnet mask) (bitwise).
- Wildcard mask: NOT subnet mask (bitwise) = 255.255.255.255 minus subnet mask.
- Total addresses in block: 2^(32 - n).
- Usable host addresses: 2^(32 - n) - 2 for prefix lengths 0 to 30. For /31, both addresses are usable (RFC 3021). For /32, there is 1 host (the address itself).
- First host: network address + 1.
- Last host: broadcast address - 1.
Worked Example: 192.168.1.0/24
The default values in this calculator use 192.168.1.0/24, the most common home and small office network range. Here is how the results are derived:
| Field | Value | Working |
|---|---|---|
| Prefix length | /24 | 24 network bits, 8 host bits |
| Subnet mask | 255.255.255.0 | 24 ones followed by 8 zeros in binary |
| Wildcard mask | 0.0.0.255 | Inverse of subnet mask |
| Network address | 192.168.1.0 | 192.168.1.0 AND 255.255.255.0 |
| Broadcast address | 192.168.1.255 | 192.168.1.0 OR 0.0.0.255 |
| First usable host | 192.168.1.1 | Network address + 1 |
| Last usable host | 192.168.1.254 | Broadcast address - 1 |
| Total addresses | 256 | 2^8 = 256 |
| Usable hosts | 254 | 256 - 2 = 254 |
Common Prefix Lengths at a Glance
| CIDR | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 (host route) |
Private IP Ranges (RFC 1918)
Three IPv4 ranges are reserved for private use and are not routed on the public internet. These are used for internal networks behind NAT (Network Address Translation):
- 10.0.0.0/8 (10.0.0.0 to 10.255.255.255) - 16,777,214 usable hosts
- 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) - 1,048,574 usable hosts
- 192.168.0.0/16 (192.168.0.0 to 192.168.255.255) - 65,534 usable hosts
Related Calculators
- Essential Calculators hub
- Bandwidth Calculator
- Base64 Encoder / Decoder
- Binary, Hex, Octal and Decimal Converter
Sources and method: IPv4 subnetting per RFC 950 (Internet Standard Subnetting Procedure). CIDR notation per RFC 4632 (Classless Inter-domain Routing). /31 point-to-point host addressing per RFC 3021. All calculations are performed in 32-bit unsigned integer arithmetic in the browser.
This tool handles IPv4 addresses only. IPv6 subnetting uses 128-bit addresses and different notation. All results are computed client-side and no data is transmitted to any server.