IP Subnet Calculator
Calculate IPv4 network boundaries, CIDR prefixes, wildcard masks, usable host ranges, and binary bit masks.
IPv4 Configuration
Network Allocation
| Subnet Mask | 255.255.255.0 |
| Wildcard Mask | 0.0.0.255 |
| Network ID | 192.168.1.0 |
| Broadcast IP | 192.168.1.255 |
| First Usable Host | 192.168.1.1 |
| Last Usable Host | 192.168.1.254 |
| Total Addresses | 256 |
IPv4 Subnet Mask & CIDR Reference Table
A breakdown of standard CIDR prefixes from /16 to /32 with total and usable host capacities:
For deeper analysis and related planning, you can also explore our Ohm's Law Calculator and Resistor Color Code Calculator.
| CIDR Prefix | Subnet Mask | Wildcard Mask | Total Addresses | Usable Hosts |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (Single Host) |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 (Point-to-Point) |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 (Standard LAN) |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 (Campus WAN) |
How Subnetting Works Under the Hood
Every IPv4 address consists of 32 binary bits divided into four 8-bit octets. When a subnet mask is applied, a bitwise logical AND operation is performed between each bit of the IP address and each bit of the mask:
- Network ID: $\text{IP} \land \text{Subnet Mask}$. All host bits are forced to 0.
- Broadcast Address: $\text{Network ID} \lor (\neg \text{Subnet Mask})$. All host bits are set to 1.
- First Usable Host: $\text{Network ID} + 1$.
- Last Usable Host: $\text{Broadcast Address} - 1$.
Special & Reserved IPv4 Ranges (RFC 1918 & RFC 5735)
- 10.0.0.0/8: Private Class A network (16.7 million addresses).
- 172.16.0.0/12: Private Class B networks (172.16.0.0 to 172.31.255.255).
- 192.168.0.0/16: Private Class C networks common in consumer Wi-Fi routers.
- 127.0.0.0/8: Localhost loopback interface.
- 169.254.0.0/16: APIPA (Automatic Private IP Addressing) used when DHCP is unavailable.
Frequently Asked Questions
What is CIDR notation in IPv4 networking?
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its associated subnet mask using a slash followed by the count of leading 1-bits in the subnet mask (e.g. 192.168.1.0/24). A /24 prefix means 24 bits are dedicated to the network ID, leaving 8 bits (254 usable addresses) for host devices.
Why are two IP addresses subtracted from the total host count?
In standard IPv4 subnets, the first IP address (all host bits set to 0) is reserved as the Network ID, and the last IP address (all host bits set to 1) is reserved as the Subnet Broadcast Address. Therefore, Usable Hosts = 2^(32 - CIDR) - 2.
What is a wildcard mask?
A wildcard mask is the bitwise inverse of a subnet mask, commonly utilized in Cisco access control lists (ACLs) and OSPF routing configurations. For example, a subnet mask of 255.255.255.0 has a wildcard mask of 0.0.0.255.
What is the difference between /30 and /31 subnets?
A /30 subnet yields 4 addresses with 2 usable host IPs (traditionally used for router-to-router point-to-point serial links). RFC 3021 introduced /31 subnets for point-to-point links, which allows both addresses to be used as host interfaces with zero network/broadcast address waste on supported modern networking equipment.
Why are private IP addresses not routable over the Internet?
RFC 1918 private IP address spaces are reserved exclusively for internal local area networks (LANs). Internet routers are explicitly configured to drop traffic originating from or destined to private address blocks. Devices communicate with public websites through Network Address Translation (NAT) gateways.