Subnet Calculator
Enter an IPv4 address and CIDR prefix to get the network and broadcast address, subnet mask, wildcard, usable host count and host range.
Results
Network
Broadcast
Usable hosts
- Subnet mask
- 255.255.255.0
- Wildcard
- 0.0.0.255
- Host range
- 192.168.1.1 – 192.168.1.254
You might also need
Educational estimates · not financial advice · free, no signup
Formula / how it works
Network = IP AND mask; hosts = 2^(32−prefix) − 2 (except /31,/32).
Detailed guide
What it is, how to use it, how to read the numbers, common mistakes, a worked example, formulas, and FAQs.
What this calculator is
A subnet calculator answers the questions every network engineer asks when planning an IPv4 address block: where does this network start and end, how many devices fit, and what is the subnet mask? You type an address such as 192.168.1.42 and a CIDR prefix such as /24, and the tool applies the mask to show the network address, broadcast address, wildcard mask, usable host count and the first and last host addresses. It is used by students preparing for networking exams, administrators splitting a block into VLANs, cloud engineers choosing VPC subnet sizes, and anyone reading a firewall rule written in CIDR form. The arithmetic is done on the 32-bit address with a bitwise AND, so the results match what routers compute.
When to use / who it helps
- You are carving a larger block, such as a /16, into smaller subnets and need to know where each one starts.
- You want to know how many devices fit in a subnet before assigning a prefix length in a cloud or router configuration.
- You are reading a firewall or routing rule written as 10.0.4.0/22 and need the actual address range it covers.
- You are studying for a networking certification and want to check hand-worked subnetting answers.
- You need the wildcard mask for an access-control list entry.
How to use
Steps
- Enter an IPv4 address in dotted form, such as 192.168.1.42. Any host address inside the subnet works; the tool finds the network for you.
- Enter the CIDR prefix length from 0 to 32. A /24 means the first 24 bits are the network portion, which equals the mask 255.255.255.0.
- Read the network address, which is the first address in the block and cannot be assigned to a host.
- Read the broadcast address, the last address in the block, which is also reserved in ordinary subnets.
- Use the host range line for the first and last assignable addresses and the usable hosts count for the capacity.
- Change the prefix by one bit to see capacity halve or double; each extra bit of prefix halves the number of hosts.
How to interpret results
- The network address identifies the subnet; two devices are on the same subnet only if their addresses give the same network after masking.
- Usable hosts is the total addresses minus the network and broadcast addresses, so a /24 has 256 addresses and 254 usable hosts.
- The wildcard mask is the bitwise inverse of the subnet mask and is the form used by some router access lists.
- A /31 has two addresses and is used on point-to-point links; a /32 identifies a single host.
- Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are reserved for internal networks and are not routed on the public internet.
Common mistakes & gotchas
- Counting 2^(32 − prefix) as the number of hosts, forgetting that the network and broadcast addresses are not assignable on ordinary subnets.
- Entering a prefix such as 255.255.255.0 instead of the number 24; this tool takes the prefix length.
- Assuming every address in a /26 belongs to the same block as the address above it; subnet boundaries fall on multiples of the block size (64 for /26).
- Using the broadcast address or network address as a host address on a standard subnet.
- Forgetting that cloud providers often reserve extra addresses in each subnet, so the usable count in practice can be lower than this tool shows.
Worked example
Worked example — 192.168.1.42 with a /26 prefix
- A /26 uses 26 network bits, so the mask is 255.255.255.192 and the host portion is 6 bits (32 − 26).
- The block size is 2^6 = 64 addresses, so subnet boundaries in the last octet are 0, 64, 128 and 192.
- The address ends in .42, which lies between 0 and 63, so the network is 192.168.1.0 and the broadcast address is 192.168.1.63.
- Usable hosts are 64 − 2 = 62, running from 192.168.1.1 to 192.168.1.62. The wildcard mask is 0.0.0.63.
Result: 192.168.1.42/26 belongs to the network 192.168.1.0 with broadcast 192.168.1.63, mask 255.255.255.192 and 62 usable hosts.
To load the form's own demo values, tap Try example above the Calculate button.
How to calculate / formula
Network = IP AND mask; hosts = 2^(32−prefix) − 2 (except /31,/32).
Frequently asked questions
What does CIDR notation mean?
CIDR writes an address followed by a slash and the number of leading bits that identify the network, such as 192.168.1.0/24. It replaced the old class A, B and C system.
How many usable hosts are in a /24?
A /24 has 256 addresses and 254 usable hosts, because the network and broadcast addresses are reserved.
What is a wildcard mask?
It is the inverse of the subnet mask. A /24 mask of 255.255.255.0 has the wildcard 0.0.0.255, which some access lists use to say which bits may vary.
Why does a /31 have no network and broadcast address?
RFC 3021 allows /31 on point-to-point links so that both addresses can be used by the two devices at each end.
Does this calculator support IPv6?
No. It handles IPv4 only. IPv6 uses 128-bit addresses and typically /64 subnets, with different planning rules.
How do I split a /24 into four subnets?
Add two bits to the prefix, giving four /26 subnets of 64 addresses each: .0, .64, .128 and .192.
Textbook formulas under ideal assumptions. For safety-critical, structural, or regulated work, verify with a qualified engineer and the governing standards. Full disclaimer