Skip to main content

IP Subnet Calculator

Calculate subnet mask, network address, broadcast, wildcard mask, and usable host ranges from any IPv4 address and CIDR prefix.

Reference table

IP Address — Octet 1CIDR NotationNetwork AddressBroadcast Address
11.168.1.0 /241.168.1.01.168.1.255
22.168.1.0 /242.168.1.02.168.1.255
33.168.1.0 /243.168.1.03.168.1.255
44.168.1.0 /244.168.1.04.168.1.255
55.168.1.0 /245.168.1.05.168.1.255
1010.168.1.0 /2410.168.1.010.168.1.255
1515.168.1.0 /2415.168.1.015.168.1.255
2020.168.1.0 /2420.168.1.020.168.1.255
2525.168.1.0 /2425.168.1.025.168.1.255
3030.168.1.0 /2430.168.1.030.168.1.255
4040.168.1.0 /2440.168.1.040.168.1.255
5050.168.1.0 /2450.168.1.050.168.1.255
6060.168.1.0 /2460.168.1.060.168.1.255
7070.168.1.0 /2470.168.1.070.168.1.255
7575.168.1.0 /2475.168.1.075.168.1.255

Subnetting Tips

  • Use /24 (254 hosts) for home or small office networks — most common subnet size.
  • Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — free for internal use.
  • First IP = network ID, last IP = broadcast — neither can be assigned to a device.
  • AWS/Azure reserve 3–5 extra IPs per subnet — always use the cloud provider mode for accurate counts.

What Is Subnetting?

Subnetting is the practice of dividing a larger IP network into smaller, independent sub-networks called subnets. Each subnet has its own address range and functions as a separate broadcast domain. This technique was introduced to solve the inefficiency of classful addressing, where organizations received far more IP addresses than they needed. By borrowing bits from the host portion of an IP address, administrators can create multiple smaller networks from a single address block, improving routing efficiency, reducing broadcast traffic, enhancing security through isolation, and making better use of limited IPv4 address space. Every IPv4 address is 32 bits long, divided into a network portion (identified by the subnet mask) and a host portion (the remaining bits). The subnet mask tells routers which part of the address identifies the network and which part identifies individual devices.

How CIDR Notation Works

Classless Inter-Domain Routing (CIDR) replaced the rigid classful system (Class A, B, C) in 1993 with RFC 1519. Instead of fixed boundaries, CIDR uses a slash followed by a number to indicate how many bits form the network prefix. For example, /24 means 24 bits are the network portion and 8 bits are for hosts, yielding 2⁸ = 256 total addresses (254 usable). The key formula is: total addresses = 2^(32 − prefix), and usable hosts = total − 2 (subtracting network and broadcast addresses). A /16 gives 65,534 usable hosts, while /28 gives only 14. CIDR enables precise allocation — an organization needing 500 addresses can get a /23 (510 hosts) instead of wasting an entire Class B (/16 with 65,534). This flexibility dramatically reduced IPv4 address exhaustion and simplified routing tables through route aggregation (supernetting).

Key Subnetting Concepts

  • Network address: the first address in a subnet — identifies the network itself and cannot be assigned to any host.
  • Broadcast address: the last address — sends packets to every host on that subnet simultaneously.
  • Wildcard mask: the bitwise inverse of the subnet mask — used in Cisco ACLs and OSPF routing configurations.
  • Plan for growth: if you need 50 hosts today, /26 (62 usable) leaves little room — consider /25 (126 usable) instead.
  • RFC 1918 private ranges are not routable on the public internet — NAT translates them to public IPs for external access.
  • Over-subnetting wastes addresses: each subnet loses 2 IPs (network + broadcast), so many tiny subnets add up.

Common Subnet Sizes

  • /32 — Single Host: Used for loopback addresses and host routes in routing tables.
  • /30 — 2 Hosts: Standard for point-to-point links between routers (also see /31 per RFC 3021).
  • /28 — 14 Hosts: Small server room, a few printers, or an IoT VLAN.
  • /24 — 254 Hosts: The most common subnet for homes, small offices, and individual VLANs.
  • /20 — 4,094 Hosts: Medium enterprise — an entire building floor or large department.
  • /16 — 65,534 Hosts: Large campus or data center; often the size of a full Class B allocation.

Subnetting Examples

Step-by-step subnet calculations

Example: 192.168.1.100 /24

  1. IP: 192.168.1.100 → Binary: 11000000.10101000.00000001.01100100
  2. CIDR /24 → Mask: 255.255.255.0 → Binary: 11111111.11111111.11111111.00000000
  3. AND operation: Network = 192.168.1.0 (first 24 bits match, last 8 zeroed)
  4. Host bits = 32 − 24 = 8 → Total addresses = 2⁸ = 256
  5. Usable hosts = 256 − 2 = 254
  6. First usable: 192.168.1.1 | Last usable: 192.168.1.254 | Broadcast: 192.168.1.255

192.168.1.0/24 supports 254 devices. Wildcard: 0.0.0.255

Example: AWS VPC 10.0.0.0 /24

  1. IP: 10.0.0.0/24 → 256 total addresses
  2. Standard: 256 − 2 = 254 usable hosts
  3. AWS reserves 5 IPs: .0 (network), .1 (VPC router), .2 (DNS), .3 (future), .255 (broadcast)
  4. AWS usable: 256 − 5 = 251 hosts
  5. First usable: 10.0.0.4 | Last usable: 10.0.0.254
  6. Azure: same 251 hosts | GCP: 252 hosts (4 reserved)

Always use cloud provider mode for accurate host counts in AWS/Azure/GCP.

Frequently Asked Questions

What is a subnet mask and why is it important?

A subnet mask is a 32-bit number that divides an IP address into the network portion and the host portion. It tells routers and devices which part of the IP address identifies the network and which part identifies individual devices. Without a subnet mask, devices cannot determine if a destination IP is on the same local network or needs to be forwarded through a router. The most common subnet mask is 255.255.255.0 (/24), which creates a network with 254 usable host addresses.

How do AWS, Azure, and GCP differ in reserved IPs per subnet?

Cloud providers reserve extra IP addresses beyond the standard network and broadcast addresses. AWS reserves 5 IPs per subnet: the network address (.0), the VPC router (.1), the DNS server (.2), reserved for future use (.3), and the broadcast address. Azure also reserves 5 IPs with a similar pattern. Google Cloud reserves 4 IPs: the network address, default gateway, broadcast, and one for DHCP. This means a /24 subnet gives you 254 hosts on standard networks, but only 251 on AWS/Azure or 252 on GCP.

What is CIDR notation and how does it relate to subnet masks?

CIDR (Classless Inter-Domain Routing) notation uses a slash followed by a number to indicate how many bits form the network prefix. For example, /24 means 24 bits are the network portion, equivalent to the subnet mask 255.255.255.0. CIDR replaced the old classful system (Class A, B, C) to allow more flexible address allocation. The formula is simple: total addresses = 2^(32 − prefix_length), and usable hosts = total addresses − 2 (subtracting the network and broadcast addresses).

What is a wildcard mask and when is it used?

A wildcard mask is the bitwise inverse of a subnet mask. Where a subnet mask has 1s, the wildcard mask has 0s, and vice versa. For example, if the subnet mask is 255.255.255.0, the wildcard mask is 0.0.0.255. Wildcard masks are primarily used in Cisco router ACLs (Access Control Lists) and OSPF routing configurations to specify which bits of an address should be matched. A wildcard mask of 0.0.0.255 means 'match the first three octets exactly, allow any value in the last octet.'

What is the difference between /30 and /31 subnets?

A /30 subnet provides 4 total addresses with 2 usable hosts — traditionally used for point-to-point links between routers. A /31 subnet (defined in RFC 3021) provides exactly 2 addresses with no network or broadcast address, making both IPs usable for point-to-point links. While /31 is more efficient (saves one IP), not all older network equipment supports it. Modern routers and most cloud providers fully support /31 for router-to-router connections.

How do I choose the right subnet size for my network?

Start by counting the number of devices that need IP addresses, then add 20–50% for growth. Use the formula: find the smallest CIDR prefix where 2^(32−prefix) − 2 ≥ your host count. For example, 50 devices need at least a /26 (62 usable), but a /25 (126 usable) provides room to grow. For cloud deployments, remember to account for the extra reserved IPs. For home networks, /24 (254 hosts) is almost always sufficient. For router links, use /30 or /31.

Sources