Enter an IPv4 address and CIDR prefix, subnet mask, or wildcard mask to find its containing network and usable address range.
Calculation details
Table of contents
How to use our IP Subnet Calculator
- Choose the mask format shown in your router, firewall, VPN, cloud network, or network document.
- Enter the IPv4 address as four numbers separated by periods, such as 192.168.1.130.
- Enter the matching CIDR prefix, subnet mask, or wildcard mask. A CIDR prefix may include the slash, such as /26.
- Click Calculate. The first card shows the containing IPv4 network, followed by its endpoints, usable range, masks, and address counts.
- Check that your entered address falls from the network address through the broadcast address and that the resolved mask matches the setting you copied.

Definitions
IPv4 address: A 32-bit address written as four decimal numbers from 0 through 255, such as 192.168.1.130.
CIDR prefix: The slash number that states how many leading bits identify the network. For example, /26 has 26 network bits and 6 host bits. CIDR describes IPv4 address blocks with prefixes. [1]
Subnet mask: A dotted-decimal value with network bits set to 1 and host bits set to 0. For example, 255.255.255.192 is the subnet mask for /26.
Wildcard mask: The bit-by-bit opposite of a subnet mask. The wildcard mask for /26 is 0.0.0.63.
Network address: The first address in a subnet, where every host bit is 0.
Broadcast address: The last address in an ordinary IPv4 subnet, where every host bit is 1.
Usable IPv4 host addresses: Addresses normally assigned to devices. Most subnets exclude the network and broadcast addresses; a /31 point-to-point link has two usable addresses, while a /32 has no conventional host range.
Common mistakes and quick fixes
Mistake: Entering an IPv4 address without entering the mask required by the selected format.
Fix: Enter both the IPv4 address and the one visible mask field.
Mistake: Using an octet such as 256 or a non-number in an IPv4 address.
Fix: Use exactly four whole-number parts, each from 0 through 255.
Mistake: Pasting 255.255.255.0 while Wildcard mask is selected.
Fix: Select Subnet mask for that value, or use its wildcard opposite, 0.0.0.255.
Mistake: Entering a CIDR prefix outside /0 through /32.
Fix: Use a whole prefix from /0 through /32. Both 24 and /24 are accepted.
Mistake: Treating total addresses as the same as usable host addresses.
Fix: Check Mask information you have and then recalculate. For /0 through /30, the network and broadcast addresses are included in the total but excluded from the usable-host count.
Mistake: Expecting a conventional host range for a /32.
Fix: A /32 identifies one IPv4 address, so it has one total address and no conventional usable host range.
Limitations & Key Assumptions / Boundary Conditions
- This calculator handles IPv4 only. It does not calculate IPv6 networks or IPv6 address ranges.
- An IPv4 address alone does not identify a subnet. You must enter an explicit CIDR prefix, subnet mask, or wildcard mask.
- A dotted subnet mask must have uninterrupted 1 bits followed by 0 bits. A wildcard mask must be the exact opposite of a valid subnet mask.
- For /0 through /30, usable-host counts exclude the network and broadcast addresses. A /31 is treated as a two-address point-to-point link, and a /32 has one total address but no conventional host range.
- The result calculates address boundaries only. It does not check routing, DHCP reservations, firewall rules, cloud-provider limits, or whether an address is already in use.
Methodology
How the subnet is calculated
The calculator converts the selected mask format into one prefix length from 0 through 32. A subnet mask must have uninterrupted 1 bits followed by 0 bits. A wildcard mask is inverted before the same check. CIDR uses a prefix length to identify the network portion of an IPv4 address. [1]
block size = 2 ^ (32 - prefix length)
The caret means raise 2 to a power. The calculator changes the four IPv4 octets into one unsigned number, finds the start of that address block, then changes the endpoints back to dotted-decimal form.
IPv4 number = first octet * 16777216 + second octet * 65536 + third octet * 256 + fourth octet
network address = floor(IPv4 number / block size) * block size
broadcast address = network address + block size - 1
Worked example
For 192.168.1.130 with /26, there are 6 host bits. The block size is 2 ^ 6, or 64 addresses. The containing network is 192.168.1.128/26, the broadcast address is 192.168.1.191, and the conventional usable range is 192.168.1.129 through 192.168.1.190. That leaves 62 usable host addresses.
Address counts
total IPv4 addresses = block size
usable IPv4 host addresses = total addresses - 2 for /0 through /30
For /31, both addresses are counted as usable on a point-to-point link. For /32, the subnet contains one address and has no conventional host range. The dotted subnet mask is 0.0.0.0 for /0; otherwise, its unsigned value is 4294967296 minus the block size. The wildcard mask is the bit-by-bit opposite of the subnet mask.