IPv4 Subnet Calculator
About this tool
About Subnet Calculator
Type an address with its prefix, such as 10.0.0.5/22, or with a dotted mask like 10.0.0.5 255.255.252.0, and the calculator shows the network address, broadcast address, first and last usable host, usable and total host counts, subnet mask, wildcard mask for ACLs, IP class and whether the address is private (RFC 1918), carrier-grade NAT, loopback, link-local, documentation or public. A binary view highlights exactly which bits belong to the network and which to hosts, and a reference table lists every prefix from /0 to /32. Point-to-point /31 links (RFC 3021) and /32 host routes are handled correctly instead of reporting negative hosts. Switch to Split a network to divide a block into equal subnets by count or new prefix, or plan VLSM from a list of host requirements, then export the plan as CSV. IP range to CIDR turns any start and end address into the shortest list of CIDR blocks for firewall rules. Everything is calculated in your browser.
Built and maintained by Abhi JainUpdated
How to Calculate a Subnet
- 1
Enter the address
Type the IP address with a /prefix or a subnet mask in the IP address field, or pick the prefix from the Prefix length list.
- 2
Read the results
The network, broadcast, usable host range, masks and address type update as you type. The Binary panel shows network and host bits.
- 3
Split or convert
Choose Split a network to divide the block by count, new prefix or host needs (VLSM), or IP range to CIDR to cover a start–end range.
- 4
Copy or export
Copy any value with its copy button, or download subnet tables as CSV.
Subnet Calculator: questions and answers
How many usable hosts are in a /24?
A /24 has 256 addresses (2^8). Two are reserved for the network and broadcast addresses, so 254 are usable. In general a prefix /n has 2^(32−n) addresses and 2^(32−n) − 2 usable hosts, except /31 (2 usable) and /32 (1).
What is a wildcard mask?
A wildcard mask is the inverse of the subnet mask: every bit flipped. For 255.255.255.0 it is 0.0.0.255. Cisco ACLs and OSPF use it to say which bits must match (0) and which can be anything (1).
How do I find the network and broadcast address?
The network address is the IP AND the subnet mask (host bits set to 0). The broadcast address is the network address OR the wildcard mask (host bits set to 1). For 192.168.10.37/26 that gives 192.168.10.0 and 192.168.10.63.
Why does a /31 have two usable hosts?
RFC 3021 lets point-to-point links use a /31 with no network or broadcast address, so both addresses go to the two routers. This saves half the space compared with a /30.
Which IPv4 ranges are private?
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. 100.64.0.0/10 is used for carrier-grade NAT, 127.0.0.0/8 is loopback and 169.254.0.0/16 is link-local. The calculator labels each of these.
What is VLSM?
Variable Length Subnet Masking gives each subnet only the size it needs. Choose Split a network, then Hosts (VLSM), list your subnets with host counts, and the tool allocates the largest first so the blocks stay aligned and nothing overlaps.
Ready-made Subnet Calculator presets
Related Tools
- IPv6 CalculatorCompress, expand and subnet IPv6 addresses and prefixes.
- IP Address ConverterConvert IPv4 between dotted, integer, hex, binary and octal.
- Chmod CalculatorLinux file permissions: checkboxes, octal, symbolic and umask.
- URL ParserSplit a URL into protocol, host, port, path, query and fragment; edit any part and rebuild it.