Calculate your IPv4 subnet mask, CIDR prefix, network address, broadcast address, and usable IP address range with our free online Subnet Mask Calculator.
Enter an IPv4 address and either a CIDR prefix or a dotted-decimal subnet mask. The calculator displays the corresponding network details, including the number of addresses in the subnet.
IPv4 networking utility Enter an IPv4 address and either a CIDR prefix or a subnet mask. Get the network address, wildcard mask, address range, and theoretical host count instantly. Calculated network / CIDR How the calculation works: A CIDR prefix specifies how many of the 32 IPv4 bits form the network portion. For example, /24 means a subnet mask of 255.255.255.0. The remaining 8 bits give 256 total addresses, conventionally 254 usable on a typical subnet. Important: The calculator uses only values you enter; it cannot detect your actual router or ISP-assigned subnet. Results are calculated in your browser, without API calls from this plugin. Site-level analytics and standard hosting logs, if enabled elsewhere, are separate. Special cases: /31 represents two usable endpoints only in the point-to-point context described by RFC 3021. /32 is one address. /0 is the default route, not a normal LAN subnet. This tool calculates IPv4, not IPv6.Subnet Mask Calculator
192.168.1.0/24
Subnet details
Entered IPv4 address CIDR prefix Network address Broadcast address First usable endpoint Last usable endpoint Address range Wildcard mask Host bits Subnet mask in binary
What Is a Subnet Mask?
A subnet mask is a 32-bit value that identifies which part of an IPv4 address represents the network and which part is available for host addressing.
For example, the IPv4 address 192.168.1.10 with subnet mask 255.255.255.0 belongs to the network 192.168.1.0/24.
The subnet mask helps devices determine whether another IP address is on the same local network or whether communication normally needs to pass through a router.
Subnet masks are used in home Wi-Fi networks, office LANs, router configurations, and larger computer networks.
How to Use the Subnet Mask Calculator
- Enter an IPv4 address. For example,
192.168.1.10. - Choose the mask format. Select CIDR prefix or dotted-decimal subnet mask.
- Enter your prefix or mask. Use
24for a/24network or255.255.255.0as its equivalent mask. - Click Calculate Subnet. Review the calculated network information.
- Copy your results. Use the Copy Results button when you need the values for your records or network configuration.
The calculator also provides quick prefix options, including /24, /26, /30, /31, and /32.
Understanding the Calculator Results
The results explain how the entered IPv4 address fits within its subnet.
| Result | What it means |
|---|---|
| Subnet Mask | Separates the network bits from the host bits |
| CIDR Prefix | Shows the number of network bits, such as /24 |
| Network Address | Identifies the calculated subnet |
| Broadcast Address | Shows the directed broadcast address on conventional IPv4 subnets |
| First Usable Address | First conventional host address, or endpoint where special rules apply |
| Last Usable Address | Last conventional host address, or endpoint where special rules apply |
| Total Addresses | Number of IPv4 addresses within the prefix |
| Usable Endpoints | Theoretical number of assignable host or endpoint addresses |
| Wildcard Mask | Bitwise inverse of the subnet mask |
| Binary Subnet Mask | Subnet mask displayed in 32-bit binary notation |
The number of usable addresses is a theoretical calculation. Actual device assignments depend on your router, network configuration, reserved addresses, and operational requirements.
Subnet Mask Calculation Example
Suppose you have the following network information:
- IPv4 Address:
192.168.1.70 - CIDR Prefix:
/26 - Subnet Mask:
255.255.255.192
The calculated results are:
| Network Detail | Value |
|---|---|
| Network Address | 192.168.1.64 |
| Subnet Mask | 255.255.255.192 |
| CIDR Notation | 192.168.1.64/26 |
| Broadcast Address | 192.168.1.127 |
| First Usable IP | 192.168.1.65 |
| Last Usable IP | 192.168.1.126 |
| Total Addresses | 64 |
| Theoretical Usable Hosts | 62 |
| Wildcard Mask | 0.0.0.63 |
A /26 prefix leaves six bits for addresses within the subnet. That produces 64 total addresses. In a conventional IPv4 subnet, two are reserved for the network and directed broadcast addresses, leaving 62 usable host addresses.
Common Subnet Masks and CIDR Prefixes
The following table shows several commonly used IPv4 subnet sizes.
| CIDR | Subnet Mask | Total Addresses | 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 |
| /31 | 255.255.255.254 | 2 | 2* |
| /32 | 255.255.255.255 | 1 | 1* |
The /31 and /32 entries have special meanings. A /31 can support two endpoints on a compatible point-to-point link, while a /32 identifies one IPv4 address. They are not conventional broadcast LAN subnets.
How Are Subnet Masks Calculated?
IPv4 addresses contain 32 bits. The CIDR prefix tells you how many bits belong to the network portion.
The number of remaining address bits is:
Host bits = 32 − CIDR prefix
The total address count is:
Total addresses = 2^(32 − CIDR prefix)
For a conventional subnet from /1 through /30, the theoretical usable host count is:
Usable hosts = Total addresses − 2
For example, a /24 subnet has eight host bits:
- 32 − 24 = 8 host bits
- 2^8 = 256 total addresses
- 256 − 2 = 254 conventional usable host addresses
A valid dotted-decimal subnet mask contains consecutive binary 1s followed by consecutive 0s. The calculator checks this rule and rejects non-contiguous masks.
Special Cases: /31, /32, and /0
A /31 prefix can assign both addresses to the endpoints of a supported point-to-point connection, as specified in RFC 3021.
A /32 prefix represents one IPv4 address, often used as a host route. It has no separate directed broadcast address.
A /0 prefix represents the entire IPv4 address space and is commonly used in default routing. The calculator does not treat it as an ordinary LAN subnet or provide a conventional usable-host range.
Subnet Masks in Home and Office Networks
Subnet masks matter when configuring home routers, office networks, static IP addresses, and separate network segments.
For example, a small office may need to divide a larger address block into several smaller networks. Using suitable prefixes helps organize addressing and determine which addresses belong to each subnet.
However, calculating a subnet does not automatically configure your router, create network isolation, or assign addresses to devices. Those tasks require the appropriate network settings.
If you are configuring a PTCL or another ISP-provided router in Pakistan, check the actual LAN addressing and subnet information in your router settings. Do not assume every router uses the same IP address or subnet mask.
Does This Calculator Detect Your Actual Network?
No. This calculator works with the IPv4 address and subnet details you enter manually.
It does not discover your router’s LAN settings, detect your public IP allocation, scan connected devices, or change network configurations.
The calculator performs its calculations in your browser without sending the entered IPv4 address or subnet mask to a third-party calculation API. Standard website hosting logs and any separately configured site analytics are outside the calculator’s calculation process.
It supports IPv4 only, not IPv6.
Technical References
The calculation principles follow published Internet Engineering Task Force documentation:
- RFC 4632: Classless Inter-domain Routing (CIDR)
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
Use the calculator above to check a subnet mask, convert between CIDR and dotted-decimal notation, or calculate the address range for your IPv4 network.