IPv4 Subnet Calculator
Calculate network address, broadcast address, host range, subnet mask, and wildcard mask from any IP and CIDR prefix.
IPv4 Subnet Calculator tool
Example
Input: 192.168.1.0/24
Result: Network 192.168.1.0, Broadcast 192.168.1.255, hosts 192.168.1.1 - 192.168.1.254, Total Hosts 254, Mask 255.255.255.0, Wildcard 0.0.0.255
A /24 leaves 8 host bits, so the block holds 2^8 = 256 addresses. The first (network) and last (broadcast) are reserved, leaving 254 usable hosts.
CIDR Prefixes, Subnet Masks and Host Counts
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /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 |
Usable hosts as the calculator counts them, including the /31 (RFC 3021) and /32 special cases.
- Enter an IPv4 address in dotted-decimal notation (for example 10.0.0.1).
- Pick a CIDR prefix from the list (for example /24 for 255.255.255.0), or type it after the address as 10.0.0.1/24.
- Read the network address, broadcast address, first and last usable host, and the host count.
- Check the subnet mask in dotted-decimal form and the class (A, B, C, D or E) of the address.
- Use the wildcard mask for router and firewall access lists, and copy any value with its copy button.
How IPv4 Subnetting and CIDR Prefixes Work
A subnet calculator tells you which addresses belong to a network. Enter an IP address and a prefix such as /24, and it shows the network and broadcast addresses, the usable host range, the host count, the subnet mask and the wildcard mask. For 192.168.1.100/24, the network is 192.168.1.0 and hosts run from .1 to .254.
The prefix is the number of bits that name the network. The rest name the host. A /24 leaves 8 host bits, so the block holds 2^8 = 256 addresses. The first is the network address and the last is the broadcast address, which leaves 254 for devices. Each extra bit in the prefix halves the block: a /25 gives 126 usable hosts and a /26 gives 62.
Two prefixes break that rule, and the calculator handles both. A /31 has only two addresses, and RFC 3021 lets both be used on a link between two routers, so the tool shows 2 hosts. A /32 is a single host, often used for loopbacks and firewall rules, so it shows 1.
You can type the prefix after the address (10.0.0.5/20) or pick it from the list. The wildcard mask is the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF use it. The tool also shows the old class (A to E) of the address, which no longer affects routing but still comes up in exams and older docs.
To list every address in a block, use the IPv4 Range Expander. To see the binary behind an address, try the IPv4 Address Converter.
Sources
Frequently Asked Questions
Related Tools
IPv4 Address Converter
Convert IPv4 addresses between decimal, binary, hexadecimal, and integer representations instantly.
Network ToolsIPv4 Range Expander
Expand CIDR notation or IP address ranges into a complete list of individual IP addresses.
Network ToolsIPv6 ULA Generator
Generate unique local IPv6 addresses (ULA) per RFC 4193 with cryptographically random prefixes.
Network ToolsNumber Base Converter
Convert numbers between binary, octal, decimal, hexadecimal, and any custom base.
Math and Numbers