logo
GeekFormat

Subnet Calculator

IPv4 Subnet Calculator

Enter IP/CIDR to calculate network address, broadcast address, usable address range, and subnet mask in real-time.

Calculation Result

Network
-64.-88.0.0
Broadcast
-64.-88.0.-1
Netmask
255.255.255.0
Wildcard
0.0.0.255
First Host
-64.-88.0.-255
Last Host
-64.-88.0.-2
Block Size
256
Binary Mask
11111111.11111111.11111111.00000000

Subnetting is one of the most fundamental yet error-prone calculation tasks for network engineers — you need to simultaneously derive subnet mask, network address, broadcast address, usable host range and block size from a CIDR notation (e.g. 192.168.1.0/24). Manual calculation involves binary bitwise operations, making it easy to make mistakes at mask bit counts and address boundaries. This tool performs all computations locally in your browser; enter any CIDR to get complete subnet parameters in seconds, suitable for network planning, device configuration, ACL rule writing and network certification study (CCNA/HCIA/Network+).

Related

Use Cases

  • When planning office or IDC room networks, calculate usable host counts and address ranges for different CIDR prefixes before finalizing VLAN and subnet plans
  • When configuring router or switch interfaces, verify subnet mask and network address correctness to avoid outages from mask misconfiguration
  • When writing firewall rules or ACLs, use wildcard mask results to quickly configure access control lists on Cisco/H3C devices
  • When troubleshooting IP conflicts or connectivity issues, confirm network address and broadcast address boundaries are correct for given IP and mask
  • When studying for CCNA/HCIA certifications, use this tool to verify manual calculations and deepen understanding of CIDR, VLSM and subnetting principles

Features

  • One-click CIDR calculation: Enter IPv4 address + CIDR prefix (e.g. 192.168.1.0/24) to auto-calculate all subnet parameters, no lookup tables needed
  • Eight complete results: Network address, broadcast address, subnet mask, wildcard mask, first host, last host, block size, binary mask
  • Pure frontend local calculation: All computation done locally in browser, no data sent to server, instant input response with no latency
  • One-click JSON copy: Results can be copied as JSON format for pasting into network design docs, scripts or reports
  • Real-time input response: Calculates as you type, supports CIDR prefixes /8 to /32 full range; auto-hides results on format errors

How to Use

  1. Enter a CIDR-format IPv4 address in the input box (e.g. 192.168.0.1/24); default example is 192.168.0.1/24
  2. Tool calculates automatically in real-time; no button click needed. Results appear immediately when input format is correct
  3. View 8 calculation results: Network, Broadcast, Netmask, Wildcard, First Host, Last Host, Block Size, Binary Mask
  4. Click "Copy JSON Result" to copy complete calculation results to clipboard for network documentation or configuration records

FAQ

What results can the subnet calculator compute?

<p>Enter a CIDR-format IPv4 address (e.g. 192.168.1.0/24), and the tool calculates 8 results in real-time: Network address, Broadcast address, Netmask (subnet mask), Wildcard mask, First Host, Last Host, Block Size (total addresses), and Binary Mask.</p>

Why can't network address and broadcast address be used?

<p>The network address (host bits all 0) identifies the subnet itself as destination network in routing tables; broadcast address (host bits all 1) sends broadcasts to all hosts. Both have special purposes; assigning to hosts causes IP stack anomalies, hence usable hosts = total - 2.</p>

Where is Wildcard Mask used?

<p>Mainly in ACL (Access Control List) and routing protocol (OSPF/EIGRP) configurations on Cisco/H3C devices. Unlike subnet masks, 0 means "must match" and 1 means "ignore". E.g., 0.0.0.255 matches only the first 24 bits (/24 network).</p>

Are calculation results uploaded to a server?

<p>No. All subnet calculations are done entirely locally in the browser via JavaScript; no data is sent to any server. Instant response with no network latency and no privacy risks.</p>

Why doesn't a /31 subnet have 0 usable hosts?

<p>A /31 subnet has only 2 addresses (block size=2), typically used for point-to-point links per RFC 3021 (no network/broadcast needed). Most scenarios use /30 for P2P links.</p>

Does the entered IP have to be a network address?

<p>No. Enter any IP within the subnet (e.g. 192.168.1.100/24); the tool auto-calculates correct network address (192.168.1.0) and all parameters.</p>

How to quickly determine if two IPs are in the same subnet?

<p>Perform bitwise AND on each IP with subnet mask; if results (network addresses) match, same subnet. E.g., 192.168.1.100/24 and 192.168.1.200/24 both yield 192.168.1.0.</p>

术语表

CIDR (Classless Inter-Domain Routing)
Notation using /prefix length to indicate the number of network bits, e.g. /24 means first 24 bits are network bits, replacing traditional Class A/B/C fixed divisions.
Subnet Mask
A 32-bit binary number where network bits are 1 and host bits are 0; bitwise AND with IP address yields the network address. E.g. /24 corresponds to 255.255.255.0.
Network Address
The first address of a subnet, with host bits all 0; used to identify the subnet itself and cannot be assigned to hosts.
Broadcast Address
The last address of a subnet, with host bits all 1; used to send broadcast packets to all hosts in the subnet and cannot be assigned to hosts.
Wildcard Mask
Result of bitwise inversion of subnet mask; 0 means must match, 1 means ignore; used in Cisco ACL and routing protocol configuration, e.g. 0.0.0.255.
VLSM (Variable Length Subnet Mask)
Using different length subnet masks within the same network to subnet on demand, improving IP address utilization.
Block Size
Total number of IP addresses in a subnet (including network and broadcast addresses), calculated as 2^(32-prefix length). E.g. /24 block size is 256.
Usable Hosts
Number of IPs assignable to end devices, equal to block size - 2 (subtracting network and broadcast addresses). /31 and /32 are special cases.
Prefix Length
The number after / in CIDR notation, indicating the number of network bits. Ranges from /0 (entire Internet) to /32 (single host).
Default Gateway
The IP address of the router interface in the subnet, usually the first usable host address, used to forward packets for cross-subnet communication.

CIDR Prefix to Subnet Mask / Usable Hosts Quick Reference

/8255.0.0.00.255.255.25516,777,21616,777,214Traditional Class A network
/16255.255.0.00.0.255.25565,53665,534Traditional Class B network
/20255.255.240.00.0.15.2554,0964,094Medium organization / Cloud VPC
/22255.255.252.00.0.3.2551,0241,022Large office network
/24255.255.255.00.0.0.255256254Most common subnet / Home / Small office
/25255.255.255.1280.0.0.127128126Split /24 into two subnets
/26255.255.255.1920.0.0.636462Small department network
/27255.255.255.2240.0.0.313230Small office / VLAN segmentation
/28255.255.255.2400.0.0.151614Router point-to-point / Data center
/29255.255.255.2480.0.0.786Smallest usable host subnet
/30255.255.255.2520.0.0.342Point-to-point link (router interconnection)
/32255.255.255.2550.0.0.011Single host / Loopback / Firewall rule

Private IP Address Ranges and Default Subnetting

10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216Class A PrivateLarge enterprise intranet / Cloud VPC large segments
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576Class B PrivateMedium enterprise / Docker default network (172.17.0.0/16)
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536Class C PrivateHome router / Small office most commonly used
169.254.0.0 – 169.254.255.255169.254.0.0/1665,536Link-LocalAuto-configuration when DHCP fails (APIPA)
127.0.0.0 – 127.255.255.255127.0.0.0/816,777,216LoopbackLocal loopback testing, does not leave network card

Authoritative References

  • Reference
  • Reference
  • Reference