Subnet Calculator
Enter any IPv4 address in CIDR notation and get the network address, broadcast address, subnet mask, usable host range, and host count, computed instantly in your browser.
| network | 192.168.1.0 |
| broadcast | 192.168.1.255 |
| mask | 255.255.255.0 |
| firstHost | 192.168.1.1 |
| lastHost | 192.168.1.254 |
| hosts | 254 |
| total | 256 |
How to use this tool
- 1
Type an IPv4 address with a prefix length into the box, for example 192.168.1.0/24. The field is pre-filled with that example to start.
- 2
Read the results table as you type. The network and broadcast addresses, dotted-decimal subnet mask, first and last usable host, usable host count, and total address count appear immediately.
- 3
Adjust the prefix length (the number after the slash) to widen or narrow the subnet and watch the host counts change.
- 4
If you see an Invalid CIDR or Invalid IP message, fix the input. The prefix must be 0 to 32 and each of the four octets must be 0 to 255.
What is CIDR notation and how does this subnet calculator work?
CIDR (Classless Inter-Domain Routing) notation writes an IPv4 subnet as address/prefix, such as 192.168.1.0/24. The prefix is the number of leading bits that identify the network; the remaining bits address hosts. A /24 fixes 24 bits and leaves 8, giving 256 total addresses. This tool parses your input, converts the dotted-decimal address to a 32-bit number, builds the mask from the prefix, then derives the network address (address AND mask) and the broadcast address (network OR the inverted mask). It reports the subnet mask in dotted-decimal form, the first and last usable host, the usable host count, and the total address count. By the classic convention it subtracts two from the total for the network and broadcast addresses to get usable hosts, so a /24 shows 254 usable. The /31 and /32 prefixes are special-cased: a /31 (RFC 3021 point-to-point link) and a /32 (single host) report both addresses as usable rather than subtracting two. The tool is IPv4 only and does not parse IPv6, VLSM tables, or wildcard masks.
Common use cases
Sizing a subnet for an office VLAN by checking how many usable hosts a /26 or /25 provides before you assign it.
Finding the network and broadcast addresses you must exclude when configuring a static DHCP address pool.
Translating a CIDR prefix into the dotted-decimal subnet mask a router or firewall interface expects, for example /22 to 255.255.252.0.
Confirming the usable host range when writing an access-control list or firewall rule for a specific subnet.
Verifying that a /31 point-to-point link between two routers gives you exactly two usable addresses with no broadcast waste.
Teaching or studying subnetting for a networking course or a CCNA exam by experimenting with prefixes and seeing host math update live.
Frequently asked questions
Why does a /24 show 254 usable hosts instead of 256?▼
How does it handle /31 and /32?▼
Does this support IPv6?▼
What counts as invalid input?▼
Does it compute VLSM, wildcard masks, or supernets?▼
Is my input sent to a server?▼
Related tools
DNS Lookup
Look up DNS records (A, AAAA, MX, TXT, NS) for any domain.
WHOIS Lookup
Get full WHOIS data for any domain.
SSL Certificate Checker
Check SSL certificate validity, issuer, and expiry.
HTTP Header Analyzer
Inspect HTTP response headers and security signals.
HTTP Status Code Checker
Check status code of any URL — single or bulk.
Redirect Chain Tracer
Follow every hop in a redirect chain.