Subnet & CIDR Calculator
Enter an IPv4 address with a prefix length (/24) or subnet mask to get the network and broadcast addresses, usable IP range and host count, with binary working and a subnet split table.
How to use
- Type an IP with a prefix, such as 192.168.0.10/24, or with a mask, such as 192.168.0.10 255.255.255.0.
- The network address, broadcast address, mask, wildcard, usable range and host count appear immediately.
- To split the block, enter the new prefix length (for example 26 turns a /24 into four /26 subnets).
- Turn on the step-by-step explanation to see the bitwise working, and use the copy buttons to take the results.
FAQ
How is the number of usable hosts calculated?
The block has 2^(32 - prefix) addresses. For /30 and shorter prefixes the first (network) and last (broadcast) addresses are not hosts, so usable hosts = 2^(32 - prefix) - 2. A /24 has 256 - 2 = 254.
Why are /31 and /32 handled differently?
Under RFC 3021 a /31 is a point-to-point link and both addresses are usable hosts (2 hosts). A /32 is a single-host route (1 host).
Why is the mask 255.0.255.0 rejected?
A valid subnet mask is a run of 1 bits followed by 0 bits. Non-contiguous masks, and wildcard values such as 0.0.0.255, are not accepted as masks.
What if the IP I enter is not the network address?
The address is ANDed with the mask and the result is calculated for the network it belongs to, with a notice. For example 172.16.5.9/12 becomes 172.16.0.0/12, which spans 172.16.0.0 to 172.31.255.255.
Which ranges are shown as private?
Only blocks that fit entirely inside the RFC 1918 ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Special ranges such as loopback or CGNAT (100.64.0.0/10) are not singled out. IPv6 is not supported.
AI agents: this calculation is available over an API without the form — see /llms.txt and the tool list at /api/calc; confirm the final result on this page.