To calculate the subnet of an IP address, pair the IPv4 address with a CIDR prefix or dotted-decimal subnet mask; the prefix tells the calculator how many leading bits identify the network. For example, /24 means 24 network bits and 8 host bits, while 255.255.255.0 expresses the same split. A subnet is not just the mask: the calculation also identifies the block's network and broadcast addresses, usable host range, address counts, and related mask values. The Subnet Calculator handles those parts together and updates the result table when the IPv4 address and mask choice are present. This is useful when planning a network segment, checking whether two addressing instructions describe the same range, or inspecting configuration values such as an access-control list or OSPF network statement. The tool is specifically for IPv4, not IPv6. The core rule is that an IPv4 address has 32 bits and the prefix length marks the boundary between network bits and host bits. For prefixes through /30, usable capacity starts at 2^(32 - prefix) and normally subtracts two reserved addresses; /31 and /32 follow their own defined rules.

What the Subnet Calculator Calculates
An IPv4 subnet is a block of addresses separated by a mask. The prefix length gives the number of leading network bits, while the remaining bits identify hosts. For ordinary prefixes through /30, the first address in the block is the network address and the last is the broadcast address. Neither endpoint can normally be assigned to a device.
The calculator turns one IPv4 address plus either a CIDR prefix or a subnet mask into the complete range and its related values. That saves you from performing each bit operation separately when you mainly need an accurate network-planning or configuration result.
Calculate a Subnet from an IP Address
Use the calculator whenever you have an IPv4 address and its prefix or mask. The input sequence is short:
- Enter the IPv4 address. Open the Subnet Calculator and type an address such as 192.168.1.10 into the address field.
- Supply the mask representation. Choose the CIDR prefix option and enter a value such as /24, or switch to Subnet mask mode and enter a dotted mask such as 255.255.255.0.
- Read the results table. Review the network and broadcast addresses, first and last usable hosts, usable and total host counts, subnet and wildcard masks, IP class, and RFC 1918 private status. The results update instantly.
CIDR and subnet-mask modes describe the same network boundary in different formats. Use CIDR when the supplied configuration uses a slash prefix, such as /24. Use subnet-mask mode when it provides four octets, such as 255.255.255.0. The address entered into the first field can be an address assigned within the block; the calculation identifies its containing network and usable range.
Read Each Result by Field
The results table is more useful when each label has a clear purpose. It separates the calculated block boundaries, assignment range, capacity, mask data, legacy class information, and private-address status.
| Result | What it represents | Why it matters |
|---|---|---|
| Network address | The result of applying the subnet mask to the entered IP with a bitwise AND operation. | Identifies the calculated address block. |
| Broadcast address | The upper boundary of an ordinary prefix; for prefixes through /30, all host bits are one. | Marks an address that is normally reserved rather than assigned to a host. |
| First and last usable host | The usable endpoints reported for the prefix. | Helps define the range available for device assignments. |
| Usable and total host counts | Assignable capacity and total block size under the applicable IPv4 rule. | Supports address-capacity checks and subnet planning. |
| Subnet mask | The network-and-host bit split written as four octets. | Provides the mask corresponding to the CIDR prefix. |
| Wildcard mask | The bit-for-bit inverse of the subnet mask. | Supports address matching in ACLs and OSPF network statements. |
| IP class | The legacy leading-bit classification of the IPv4 address. | Provides reference information without replacing the CIDR boundary. |
| RFC 1918 private status | Whether the address belongs to a designated private IPv4 block. | Helps distinguish internal addressing from publicly routed space. |
For prefixes through /30, the network and broadcast endpoints account for the usual two-address reduction in usable capacity. The IP class shown in the table is legacy information; CIDR, rather than old fixed class boundaries, determines the current network and host split.
Work Through One /24 Calculation
Use 192.168.1.10/24 as one complete example. The host-bit count is 32 - 24 = 8. The total address count is therefore 2^8 = 256. Applying the ordinary usable-host rule gives 2^8 - 2 = 254 usable addresses.
The subnet mask is 255.255.255.0. The network calculation is 192.168.1.10 AND 255.255.255.0 = 192.168.1.0. The wildcard mask is 0.0.0.255, so the broadcast calculation is 192.168.1.0 OR 0.0.0.255 = 192.168.1.255. The first usable host is 192.168.1.1, and the last is 192.168.1.254.
The entered address also receives a legacy class label of C and an RFC 1918 private-status result because it belongs to the private space covering 192.168.0.0/16. These values should agree in the calculator's results table.
Match CIDR, Subnet Mask, and Wildcard
CIDR notation expresses the split compactly: the number after the slash states how many leading bits form the network portion. A subnet mask expresses that same split in four octets by placing one bits in the network positions and zero bits in the host positions. Once the network and mask are known, the basic calculations are network = IP AND mask and broadcast = network OR wildcard.
The wildcard mask performs the opposite bit operation from the subnet mask. A 1 bit means that position can match any value, while a 0 bit must match. This is why wildcard masks appear in Cisco access-control lists and OSPF network statements. Treat the wildcard as a derived matching mask, not as another way to state the subnet boundary.
Handle /31 and /32 as Exceptions
The subtraction rule applies to prefixes through /30, but it must not be forced onto the two smallest IPv4 prefix sizes. Under RFC 3021, a /31 is used for IPv4 point-to-point links. Its two addresses are both usable hosts, and there is no separate network or broadcast address, so the calculator reports 2 usable hosts.
A /32 describes one IPv4 address. The network, broadcast, and host labels all represent that same address, so the calculator reports 1 usable host. This form represents a single-host route and is commonly written for loopbacks and single-host firewall rules. The calculator handles both exceptions rather than returning the misleading result produced by applying the ordinary two-address subtraction.
Check Private Scope and Confirm the Result
Private status is an important separate check. RFC 1918 defines the private IPv4 blocks as 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These ranges are reserved for internal use and are not routed on the public Internet. Confirming the result helps avoid treating an internal address as a public service address.
All calculations use 32-bit unsigned bitwise math in your browser. No entered address or query leaves your device. Before using the output, confirm that the address is IPv4, the CIDR prefix or mask matches the intended block, and the usable-host rule matches the prefix. Then verify the network and broadcast boundaries, usable range, counts, subnet mask, and wildcard mask together. For /31 and /32, apply their special endpoint rules rather than reserving two addresses automatically.