Subnet Calculator — Free Online Tool

Calculate IPv4 subnets from CIDR notation. See network address, broadcast, usable IPs, subnet mask, wildcard mask. Supports CIDR /8 to /32. Instant results.

Use this free online Subnet Calculator directly in your browser. No signup required, no data leaves your device. Part of Utilier — a collection of 133+ developer utilities.

What is IP Subnet Calculator (IPv4 & CIDR)?

A subnet calculator takes an IPv4 address with CIDR notation (e.g., 192.168.1.0/24) and computes all subnet details: network address, broadcast address, first/last usable IP, subnet mask, wildcard mask, number of usable hosts, and IP class. This tool helps network engineers, system administrators, and developers plan IP addressing schemes, configure routers, and troubleshoot network connectivity issues.

  • CIDR notation parsing: Enter an IP address with CIDR prefix (192.168.1.0/24, 10.0.0.0/8). The tool extracts the network portion and calculates all subnet properties.
  • Network and broadcast addresses: Shows the network address (first IP in the subnet) and broadcast address (last IP). These are reserved and not usable for hosts.
  • Usable IP range: Displays the first and last usable IP addresses for hosts (network + 1 to broadcast - 1). For /24, that is 192.168.1.1 to 192.168.1.254.
  • Subnet mask and wildcard mask: Converts CIDR prefix to dotted-decimal subnet mask (255.255.255.0) and wildcard mask (0.0.0.255) for ACLs and routing.
  • Host count: Calculates the number of usable hosts (2^(32-prefix) - 2). For /24, that is 254 hosts. For /30, 2 hosts (point-to-point links).

Why use subnet calculator?

Subnetting is fundamental to IP networking. Calculating subnet details manually is error-prone and time-consuming. This tool does it instantly and accurately.

  • Plan IP address schemes: When designing a network, you need to know how many IPs are available in each subnet. The tool shows usable host count for any CIDR prefix.
  • Configure routers and firewalls: Routers and firewalls require subnet masks, network addresses, and wildcard masks for routing and ACLs. This tool provides all values instantly.
  • Troubleshoot connectivity issues: If two devices cannot communicate, check if they are in the same subnet. The tool shows the network address and range for verification.
  • Learn subnetting: Visual display of network/broadcast addresses, usable range, and binary representations helps understand how subnetting works.
  • Avoid manual calculation errors: Subnet math (binary AND operations, wildcard calculations) is tedious and error-prone. This tool guarantees correct results.
  • Fast subnet splitting: For subnet planning (splitting /24 into /26 subnets), quickly calculate the ranges for each split.

When to use subnet calculator

Use whenever you need to work with IPv4 subnets.

  • Designing IP addressing schemes for new networks or VLANs.
  • Configuring routers, switches, or firewalls with subnet masks and network addresses.
  • Setting up VPN subnets or VPC networks in cloud platforms (AWS, Azure, GCP).
  • Troubleshooting why devices on different subnets cannot communicate.
  • Planning IP allocation for DHCP servers (usable IP range).
  • Studying for networking certifications (CCNA, Network+) that require subnetting knowledge.
  • Creating firewall ACLs or routing rules that use wildcard masks.

How to use subnet calculator

Enter an IP address with CIDR prefix and see all subnet details.

  1. Enter IP address with CIDR: Type an IPv4 address with CIDR notation: 192.168.1.0/24, 10.0.0.0/8, 172.16.0.0/16. The format is IP/prefix where prefix is 0-32.
  2. View network address: The network address is the first IP in the subnet (all host bits set to 0). This is the subnet identifier used in routing tables.
  3. Check usable IP range: The tool shows the first usable IP (network + 1) and last usable IP (broadcast - 1). These IPs can be assigned to hosts.
  4. See broadcast address: The broadcast address is the last IP in the subnet (all host bits set to 1). Used for broadcast packets to all hosts in the subnet.
  5. Copy subnet mask or wildcard mask: The subnet mask (255.255.255.0) is for network configuration. The wildcard mask (0.0.0.255) is for ACLs and OSPF.
  6. Check host count: The number of usable hosts is 2^(32-prefix) - 2 (minus network and broadcast addresses). For /24, that is 254 hosts.

Key features

  • CIDR notation support: Accepts standard CIDR format (192.168.1.0/24). Prefix range /0 to /32.
  • Network and broadcast calculation: Computes network address (first IP) and broadcast address (last IP) using bitwise AND/OR operations.
  • Usable IP range: Shows first and last usable IPs (network + 1 to broadcast - 1). Excludes network and broadcast addresses.
  • Subnet mask conversion: Converts CIDR prefix to dotted-decimal subnet mask (255.255.255.0) and binary representation.
  • Wildcard mask: Displays wildcard mask (inverse of subnet mask) for ACLs and routing protocols (OSPF, EIGRP).
  • Host count: Calculates number of usable hosts (2^(32-prefix) - 2). Shows maximum devices per subnet.
  • IP class detection: Identifies IP class (A, B, C, D, E) and whether the IP is private (RFC 1918) or public.

Common use cases

  • Network design: Plan IP addressing for offices, data centers, or cloud VPCs. Calculate how many subnets and hosts per subnet are needed.
  • Router configuration: Configure router interfaces with network address, subnet mask, and broadcast address.
  • DHCP setup: Define DHCP pool ranges using the usable IP range (first to last usable IP).
  • Firewall ACL rules: Create access control lists using network address and wildcard mask to match entire subnets.
  • Cloud VPC planning: Plan AWS VPC, Azure VNet, or GCP VPC subnets with appropriate CIDR blocks.
  • Subnetting study: Practice subnetting for CCNA, Network+, or other networking certifications.

Examples

Subnet calculations for common CIDR blocks.

Typical home/office network (/24)

192.168.1.0/24
Network: 192.168.1.0, Broadcast: 192.168.1.255, Usable: 192.168.1.1 - 192.168.1.254, Hosts: 254, Mask: 255.255.255.0

/24 is the most common subnet for small networks. 254 usable IPs is enough for most home/office LANs. Subnet mask 255.255.255.0 means the first 3 octets are network, last octet is host.

Large corporate network (/16)

10.0.0.0/16
Network: 10.0.0.0, Broadcast: 10.0.255.255, Usable: 10.0.0.1 - 10.0.255.254, Hosts: 65,534, Mask: 255.255.0.0

/16 provides 65,534 usable IPs. Often split into smaller subnets (/24, /26) for VLANs or departments. First 2 octets are network, last 2 are host.

Point-to-point link (/30)

172.16.0.0/30
Network: 172.16.0.0, Broadcast: 172.16.0.3, Usable: 172.16.0.1 - 172.16.0.2, Hosts: 2, Mask: 255.255.255.252

/30 is used for point-to-point links (router-to-router). Only 2 usable IPs (one for each end). Efficient for WAN connections where only 2 devices need IPs.

Single host (/32)

8.8.8.8/32
Network: 8.8.8.8, Broadcast: 8.8.8.8, Usable: none (or 8.8.8.8), Hosts: 1, Mask: 255.255.255.255

/32 represents a single host. Often used in routing tables to specify an exact IP. No usable range (network = broadcast = host address).

Small subnet for devices (/26)

192.168.1.64/26
Network: 192.168.1.64, Broadcast: 192.168.1.127, Usable: 192.168.1.65 - 192.168.1.126, Hosts: 62, Mask: 255.255.255.192

/26 provides 62 usable IPs. Good for segmenting networks (e.g., splitting a /24 into four /26 subnets). Mask 255.255.255.192 means first 26 bits are network.

Technical reference

IPv4 subnetting rules and calculations:

IPv4 address format
32-bit address written as four octets (0-255.0-255.0-255.0-255). Example: 192.168.1.1
CIDR prefix range
/0 to /32. /0 = entire internet (0.0.0.0/0). /32 = single host (255.255.255.255 mask)
Network address
First IP in subnet. All host bits = 0. Example: 192.168.1.0 for 192.168.1.0/24
Broadcast address
Last IP in subnet. All host bits = 1. Example: 192.168.1.255 for 192.168.1.0/24
Usable IP range
Network + 1 to Broadcast - 1. Excludes network and broadcast addresses. Example: 192.168.1.1 to 192.168.1.254 for /24
Host count formula
2^(32 - prefix) - 2. Minus 2 for network and broadcast. Example: /24 = 2^8 - 2 = 254 hosts
Subnet mask
Dotted-decimal representation of CIDR prefix. /24 = 255.255.255.0. /16 = 255.255.0.0
Wildcard mask
Inverse of subnet mask (255 - each octet). For 255.255.255.0, wildcard is 0.0.0.255. Used in ACLs
Private IP ranges (RFC 1918)
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Reserved for internal networks, not routable on internet
Comparison to IPv6
IPv6 uses /64 subnets typically. IPv4 subnets vary by need (/24, /16, /30). IPv6 has vastly more addresses (128-bit vs 32-bit)

Common mistakes to avoid

Using the network address (e.g., 192.168.1.0) as a host IP

Why it happens: The network address (first IP in the subnet, all host bits = 0) is reserved to identify the subnet itself. It cannot be assigned to a device. If you configure a device with the network address, it may fail to communicate or cause IP conflicts. Routers use the network address in routing tables, but it is never assigned to an interface as a host IP (except in /31 point-to-point links, per RFC 3021).

How to avoid it: Always use IPs from the usable range (network + 1 to broadcast - 1). For 192.168.1.0/24, the usable range is 192.168.1.1 to 192.168.1.254. The first usable IP (192.168.1.1) is often assigned to the router/gateway. Assign host IPs starting from 192.168.1.2 or higher.

Using the broadcast address (e.g., 192.168.1.255) as a host IP

Why it happens: The broadcast address (last IP in the subnet, all host bits = 1) is reserved for broadcast packets sent to all hosts in the subnet. If you assign it to a device, the device may not receive traffic, and broadcasts may fail. Some devices reject this configuration outright.

How to avoid it: Never assign the broadcast address to a host. For 192.168.1.0/24, the broadcast is 192.168.1.255 — do not use it. The last usable IP is 192.168.1.254. Assign hosts up to .254, leaving .255 reserved for broadcasts.

Mismatching subnet mask on devices in the same subnet

Why it happens: If Device A has IP 192.168.1.10/24 (mask 255.255.255.0) and Device B has 192.168.1.20/16 (mask 255.255.0.0), they think they are in different subnets. Device A thinks the subnet is 192.168.1.0/24. Device B thinks it is 192.168.0.0/16. They may not communicate even though their IPs are numerically close. This is a common misconfiguration.

How to avoid it: Ensure all devices in a subnet use the same subnet mask. For a /24 network, every device must have /24 (255.255.255.0). Check DHCP settings or static IP configurations for consistency. Routers and switches will not forward traffic correctly if masks differ.

Forgetting to subtract 2 when calculating usable hosts (counting network and broadcast as usable)

Why it happens: The formula for usable hosts is 2^(32 - prefix) - 2. The -2 accounts for network and broadcast addresses. For /24, 2^8 = 256 total IPs, but 256 - 2 = 254 usable. If you forget the -2, you overestimate capacity. For example, planning a /24 for 256 devices fails because only 254 IPs are usable.

How to avoid it: Always subtract 2 from the total IP count. Use the tool's 'Usable Hosts' field instead of calculating manually. For /30 (point-to-point links), 2^2 - 2 = 2 usable IPs (correct). For /31 (special case per RFC 3021), there are 2 usable IPs (no network/broadcast).

Using wildcard mask instead of subnet mask (or vice versa) in router/firewall configuration

Why it happens: Subnet mask and wildcard mask are inverses. Subnet mask has 1s for network bits, 0s for host bits (255.255.255.0). Wildcard mask has 0s for network bits, 1s for host bits (0.0.0.255). Routers use subnet masks for interface configuration and wildcard masks for ACLs/OSPF. If you mix them up, the configuration fails or matches the wrong IPs.

How to avoid it: For interface configuration, use subnet mask (255.255.255.0). For ACLs (access-list 10 permit 192.168.1.0 0.0.0.255), use wildcard mask (0.0.0.255). To convert: wildcard = 255 - each octet of subnet mask. Example: 255.255.255.0 → wildcard 0.0.0.255.

Frequently asked questions

What does /24 mean in CIDR notation?

/24 means the first 24 bits of the IP address are the network portion, leaving 8 bits for hosts. For 192.168.1.0/24, the network is 192.168.1 (first 3 octets), and the host range is 0-255 (last octet). This gives 2^8 = 256 total IPs, minus 2 (network and broadcast) = 254 usable IPs. Subnet mask is 255.255.255.0.

How many usable IPs are in a /30 subnet?

2. A /30 subnet has 2^(32-30) = 4 total IPs. Minus network and broadcast = 2 usable IPs. This is used for point-to-point links (router-to-router connections) where only 2 devices need IPs. Example: 10.0.0.0/30 has usable IPs 10.0.0.1 and 10.0.0.2.

What is the difference between subnet mask and wildcard mask?

Subnet mask has 1s for network bits, 0s for host bits (255.255.255.0 for /24). Wildcard mask is the inverse: 0s for network bits, 1s for host bits (0.0.0.255 for /24). Subnet masks are used in interface configuration. Wildcard masks are used in ACLs and routing protocols (OSPF, EIGRP). To convert: wildcard = 255 - each octet of subnet mask.

Can I use the network address or broadcast address for a host?

No. The network address (first IP) identifies the subnet and is reserved. The broadcast address (last IP) is for broadcast packets. Neither can be assigned to a device. Exception: /31 subnets (RFC 3021) for point-to-point links allow both IPs as usable (no network/broadcast).

What is a private IP address (RFC 1918)?

Private IPs are reserved for internal networks and not routable on the public internet. The ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. They are used in home, office, and corporate LANs. Public IPs are routable on the internet and assigned by ISPs or registries (ARIN, RIPE).

How do I split a /24 into multiple smaller subnets?

To split a /24 into smaller subnets, increase the CIDR prefix. /24 → /25 (2 subnets, 126 hosts each). /24 → /26 (4 subnets, 62 hosts each). /24 → /27 (8 subnets, 30 hosts each). Each increase in prefix doubles the number of subnets and halves the hosts. Use a subnet calculator to find the network address for each split.

What is the largest subnet (most IPs)?

/0 represents the entire IPv4 address space (0.0.0.0/0). It has 2^32 = ~4.3 billion IPs. Practically, the largest usable subnet is /8 (16 million IPs). For private networks, 10.0.0.0/8 is the largest private subnet (16.7 million IPs).

References

Privacy and availability

  • Runs entirely in your browser — zero server processing
  • No signup or account required
  • Works offline once loaded
  • Fast, lightweight, no external dependencies
  • Available as a browser extension for Chrome and Firefox