🌐Subnet Calculator

Calculate network address, broadcast address, usable hosts, subnet mask, wildcard mask, and IP class for any IPv4 subnet.

Prefer to skip the form? Scroll down and Ask AI Instead. Just describe your situation and let AI handle the math for you in seconds.

Usable Hosts

254

Network: 192.168.1.0/24. Subnet: 255.255.255.0. Usable hosts: 254 (192.168.1.1 to 192.168.1.254). Class C, Private.

Network Address192.168.1.0
Broadcast / Last Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Hosts254
IP Class / Address TypeClass C
ScopePrivate (RFC 1918)

Subnet Summary

256

254

Advertisement

728 × 90

✦ Ask AI Instead

Subnet Calculator: Master IP Subnetting and CIDR Notation

Whether you are designing a corporate LAN, preparing for a networking exam, or troubleshooting a connectivity problem, this subnet calculator and IP subnet calculator online gives you every detail you need: network address, broadcast address, usable host range, subnet mask, wildcard mask, and IP class, all from a single IP address and CIDR prefix.

CIDR Subnet Calculator for IPv4 Networks: The Fundamentals

A subnet, short for subnetwork, is a logically defined segment of a larger IP network. Subnetting serves several practical purposes in network planning: it reduces unnecessary broadcast traffic that would otherwise flood every device on the network, isolates segments for security, and allows more precise allocation of the limited IPv4 address space.

CIDR stands for Classless Inter-Domain Routing. CIDR notation represents a subnet as an IP address paired with a prefix length separated by a slash, such as 192.168.1.0/24. The prefix length tells you how many of the 32 bits in the IP address are reserved for the network portion. The remaining bits describe individual host addresses within that network. A /24 prefix leaves 8 bits for hosts, which yields 256 total addresses. Because the network address and broadcast address are always reserved, the usable host count is 254.

Before CIDR was introduced in 1993, IPv4 networks were divided into rigid classes. Class A networks used an 8-bit prefix (/8), Class B used /16, and Class C used /24. CIDR replaced that system with flexible, variable-length prefixes, allowing network engineers to allocate exactly the size of block a network requires rather than rounding up to the nearest class boundary. This flexibility is why CIDR notation is standard in all modern networking contexts.

How to Calculate Subnet Mask and Host Range

The subnet mask is derived directly from the CIDR prefix length using binary math. A /24 mask consists of 24 ones followed by 8 zeros in binary: 11111111.11111111.11111111.00000000, which translates to 255.255.255.0 in dotted decimal notation. The mask is applied to an IP address using a bitwise AND operation to extract the network address. Every IP in the same subnet shares the same network address after this operation.

The broadcast address is the last address in the subnet, where all host bits are set to 1. For 192.168.1.0/24, the broadcast address is 192.168.1.255. Any packet addressed to the broadcast address is delivered to every host in the subnet. The first usable host is one above the network address (192.168.1.1) and the last usable host is one below the broadcast address (192.168.1.254).

The wildcard mask is the bitwise inverse of the subnet mask. For a /24, the wildcard is 0.0.0.255. Wildcard masks appear in Cisco router ACLs and OSPF configurations, where they define which bits of an address must match a condition and which bits are irrelevant.

Subnet Calculator for Network Planning: Common Prefix Sizes

Choosing the right prefix length is the core decision in subnetting. Picking a subnet that is too small means running out of host addresses as the network grows. Picking one that is too large wastes address space that could be used elsewhere.

  • /8 (255.0.0.0): Over 16 million usable hosts. Used by very large organizations and ISPs.
  • /16 (255.255.0.0): 65,534 usable hosts. Common for large enterprise networks and data centers.
  • /24 (255.255.255.0): 254 usable hosts. The standard choice for home networks, small offices, and individual VLANs.
  • /25 (255.255.255.128): 126 usable hosts. Useful when splitting a /24 into two equal halves.
  • /26 (255.255.255.192): 62 usable hosts. Suitable for medium-sized departments or wireless segments.
  • /28 (255.255.255.240): 14 usable hosts. Ideal for small VLANs such as printers or IP phones.
  • /30 (255.255.255.252): 2 usable hosts. The standard for point-to-point router links.
  • /31: Per RFC 3021, both addresses are assignable, making it useful for point-to-point links where broadcast is not needed.

Private IP Ranges and Network Address Translation

RFC 1918 reserves three IPv4 address ranges exclusively for private, non-routable use. These addresses are used inside homes, offices, and data centers but are never forwarded across the public internet. Your router performs Network Address Translation (NAT) to map private addresses to a single public IP provided by your ISP.

The three private ranges are 10.0.0.0/8 (Class A, supporting over 16 million devices), 172.16.0.0/12 (Class B, supporting roughly 1 million devices), and 192.168.0.0/16 (Class C, supporting 65,536 devices). Most home routers default to the 192.168.0.0/24 or 192.168.1.0/24 range. Enterprise networks often use the 10.0.0.0/8 block to accommodate growth without renumbering.

Frequently Asked Questions

What is a subnet mask?

A subnet mask is a 32-bit number that identifies which portion of an IP address belongs to the network and which portion identifies individual hosts. It is written in dotted decimal notation, such as 255.255.255.0 for a /24 network. When you apply the subnet mask to an IP address using a bitwise AND operation, the result is the network address. Every device sharing the same network address is on the same subnet and can communicate directly without a router.

How do I calculate the number of usable hosts in a subnet?

Raise 2 to the power of the number of host bits (32 minus the prefix length), then subtract 2 for the reserved network address and broadcast address. For a /24, that is 2 to the power of 8 = 256, minus 2 = 254 usable hosts. For a /26, it is 2 to the power of 6 = 64, minus 2 = 62 usable hosts. The exception is /31 networks, where RFC 3021 allows both addresses to be used for point-to-point links, and /32, which represents a single host address.

What does CIDR notation mean?

CIDR stands for Classless Inter-Domain Routing. CIDR notation combines an IP address with a prefix length using a slash, such as 10.0.0.0/8 or 192.168.100.0/28. The number after the slash tells you how many bits of the 32-bit IP address form the network prefix. The remaining bits are available for host addresses. CIDR replaced the older Class A, B, and C system in 1993 because it allows flexible, variable-length subnet allocation rather than forcing every network into one of three fixed sizes.

How do I subnet a network?

Start by identifying how many hosts each subnet needs. Add a small buffer for future growth, then choose a prefix length that provides at least that many usable addresses. If you have a /24 block (254 hosts) and need four subnets of roughly 50 hosts each, a /26 (62 hosts each) fits well and creates exactly four equal subnets from the /24. Next, identify the network addresses for each /26: the first is x.x.x.0, the second x.x.x.64, the third x.x.x.128, and the fourth x.x.x.192. Assign host addresses from the first usable address to the last usable address in each subnet.