Subnet Calculator
Enter an IP and mask to get the network address, broadcast address and usable host range
输入 IP 地址与前缀
支持 IP/前缀长度、IP 子网掩码 两种写法,例如 10.0.5.130/25、172.16.3.9 255.255.240.0
About this tool
The subnet calculator turns the question of how many hosts fit in a block into one input with every answer shown, a common tool for network operations, data center planning and firewall rules:
- Two notations: prefix form
192.168.1.100/26and dotted mask form192.168.1.100 255.255.255.192both work - Full subnet parameters: network address, subnet mask, wildcard mask, broadcast address and usable host range
- Host counts: total addresses and usable hosts after removing the network and broadcast addresses, with standard handling for /31 and /32
- Binary view: IP and mask expanded per octet so network and host bits are visible
- Range classification: identifies private, loopback, link-local, carrier-grade NAT, multicast, reserved or public addresses
- Quick prefix switch: jump between /8 and /31 while comparing capacity
When to use it
- Planning VLANs and checking how many endpoints each segment can hold
- Confirming segment boundaries and wildcard masks for switches, firewalls and ACLs
- Filling cloud security group ranges without a CIDR typo that opens too much
- Diagnosing why two hosts cannot ping each other by checking they share a subnet
- Checking answers for subnetting exercises in a networking course
Common questions
- Why only 254 hosts on a /24? A /24 holds 2 to the 8th, or 256 addresses; the network and broadcast addresses take one each, leaving 254 for hosts
- What is a wildcard mask? It is the bitwise inverse of the mask, so a /26 mask 255.255.255.192 gives 0.0.0.63, the form used by Cisco ACLs and OSPF network statements
- What about /31 and /32? A /32 is a single host address; a /31 follows RFC 3021 for point-to-point links where both addresses are usable, so two hosts
- How do I know two IPs share a subnet? AND each IP with the mask; equal results mean the same subnet, and the binary view here makes that comparison direct
Common prefix reference
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /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 |
To check where a public IP is registered, use the IP lookup tool; to split a URL into host, port and parameters, use the URL parser. All calculations run in the browser and the IP you enter is never uploaded.