Answers to the most common questions about IPv4 subnetting, CIDR notation, subnet masks, and using this calculator.
A subnet mask is a 32-bit number that defines which part of an IP address refers to the network and which part refers to individual hosts. It always consists of a continuous block of 1-bits followed by a continuous block of 0-bits.
Written in dotted-decimal format, common subnet masks look like:
255.0.0.0 — Class A default (/8)255.255.0.0 — Class B default (/16)255.255.255.0 — Class C default (/24)The mask is applied to an IP address using a bitwise AND operation to determine the network address of that host.
The /24 is CIDR (Classless Inter-Domain Routing) notation. The number after the slash indicates how many bits of the 32-bit address are the network portion.
/24 means the first 24 bits are fixed (the network), leaving 8 bits for hosts. This gives:
255.255.255.0Every subnet reserves two addresses that cannot be assigned to devices:
192.168.1.0/24, the network address is 192.168.1.0.192.168.1.0/24, the broadcast address is 192.168.1.255.This is why usable hosts = total addresses − 2, not just total addresses.
The usable host range is everything between the network address and the broadcast address:
For example, 10.0.0.0/24:
Network: 10.0.0.0 First host: 10.0.0.1 Last host: 10.0.0.254 Broadcast: 10.0.0.255
Our calculator displays the full range instantly — just enter your IP and prefix.
Here are the most commonly used subnet sizes and their usable host counts:
| CIDR | Subnet Mask | Total | Usable Hosts |
|---|---|---|---|
| /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 |
Formula: Usable hosts = 2(32 − prefix) − 2
CIDR (Classless Inter-Domain Routing) is a method for representing IP networks by appending a prefix length to an address with a slash. It replaced the older classful system in 1993 to allow more efficient allocation of address space.
The prefix length indicates how many leading bits of the address are fixed. 10.0.0.0/8 means the first 8 bits (the "10" part) define the network, and the remaining 24 bits are available for hosts.
CIDR also enables route aggregation (supernetting) — combining multiple smaller networks into a single routing entry to reduce routing table size.
Both are used for point-to-point links, but they work differently:
For most purposes, /30 is the safer choice due to broader support.
A /32 subnet contains exactly one IP address — all 32 bits are fixed. It is used to represent a single host route, most commonly in:
1.1.1.1/32)Private IP addresses (defined in RFC 1918) are reserved for use within private networks and are not routable on the public internet. NAT (Network Address Translation) is used to map them to public IPs for internet access.
The three private ranges are:
10.0.0.0/8 — 10.0.0.0 to 10.255.255.255 (16.7 million addresses)172.16.0.0/12 — 172.16.0.0 to 172.31.255.255 (1 million addresses)192.168.0.0/16 — 192.168.0.0 to 192.168.255.255 (65,536 addresses)Home routers typically use the 192.168.x.x range. Large enterprises often use 10.x.x.x for maximum flexibility.
The loopback address 127.0.0.1 (also known as "localhost") is a special address that refers to the local machine itself. The entire 127.0.0.0/8 range is reserved for loopback.
Traffic sent to any address in 127.x.x.x never leaves the machine — it is processed entirely within the operating system's network stack. This is commonly used to test network applications locally without a physical network connection.
This range, known as APIPA (Automatic Private IP Addressing) or link-local, is automatically assigned by Windows, macOS, and Linux when a device cannot obtain an IP from a DHCP server.
If you see a device with a 169.254.x.x address, it typically means the device failed to reach a DHCP server. Check your network connection, DHCP server status, and cable/wireless configuration.
A wildcard mask is the bitwise inverse of a subnet mask — calculated by subtracting each octet from 255. Where a subnet mask uses 1s to indicate the network, a wildcard mask uses 0s to indicate "must match" bits.
Subnet mask: 255.255.255.0 → /24 Wildcard mask: 0.0.0.255 (255−255, 255−255, 255−255, 255−0)
Wildcard masks are used in:
permit 192.168.1.0 0.0.0.255 permits all addresses in the 192.168.1.0/24 rangeA wildcard of 0.0.0.0 means match exactly one specific host. A wildcard of 255.255.255.255 means match any address.
For any valid IP address and prefix or subnet mask, the calculator returns:
Yes. The calculator accepts both formats:
192.168.1.0/24192.168.1.0 + 255.255.255.0The results are identical regardless of which format you use — they describe the same network. The calculator will also display the equivalent representation in the output.
The calculator requires a valid IPv4 address — four octets each between 0 and 255. The following are not valid inputs:
Additionally, while technically valid IPv4, some ranges like 0.0.0.0 and 255.255.255.255 have special meanings and may produce results without usable hosts.
Check out our full subnetting guide or jump straight into the calculator.
Read the guide Open calculator