Home › Network tools › Subnet Calculator
🔧

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/26 and dotted mask form 192.168.1.100 255.255.255.192 both 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

PrefixSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

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.