NetToolsPAKISTAN

Subnet Mask Calculator

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

Subnet Mask Calculator

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.

Example: enter 192.168.1.10 with prefix 24 to calculate the 192.168.1.0/24 subnet. IPv4 only.

Try a prefix:

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.

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

  1. Enter an IPv4 address. For example, 192.168.1.10.
  2. Choose the mask format. Select CIDR prefix or dotted-decimal subnet mask.
  3. Enter your prefix or mask. Use 24 for a /24 network or 255.255.255.0 as its equivalent mask.
  4. Click Calculate Subnet. Review the calculated network information.
  5. 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.

ResultWhat it means
Subnet MaskSeparates the network bits from the host bits
CIDR PrefixShows the number of network bits, such as /24
Network AddressIdentifies the calculated subnet
Broadcast AddressShows the directed broadcast address on conventional IPv4 subnets
First Usable AddressFirst conventional host address, or endpoint where special rules apply
Last Usable AddressLast conventional host address, or endpoint where special rules apply
Total AddressesNumber of IPv4 addresses within the prefix
Usable EndpointsTheoretical number of assignable host or endpoint addresses
Wildcard MaskBitwise inverse of the subnet mask
Binary Subnet MaskSubnet 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 DetailValue
Network Address192.168.1.64
Subnet Mask255.255.255.192
CIDR Notation192.168.1.64/26
Broadcast Address192.168.1.127
First Usable IP192.168.1.65
Last Usable IP192.168.1.126
Total Addresses64
Theoretical Usable Hosts62
Wildcard Mask0.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.

CIDRSubnet MaskTotal AddressesUsable Hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422*
/32255.255.255.25511*

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:

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.