Skip to content
Other

IP Subnet Calculator

Enter an IPv4 address and select a CIDR prefix length to instantly get the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total addresses, and usable host count. The step-by-step panel shows the exact bitwise arithmetic so you can verify every figure.

Your details

Any valid IPv4 address in dotted-decimal notation (e.g. 192.168.1.100 or 10.0.0.1).
The number of bits in the network portion. /24 is the most common LAN size (254 usable hosts).
Network Address
192.168.1.0

The first address in the subnet, identifying the network itself.

Broadcast Address192.168.1.255
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Usable Hosts254
Total Addresses256
CIDR Notation192.168.1.0/24
IP ClassC

Subnet 192.168.1.0/24: 254 usable hosts.

  • This address belongs to the RFC 1918 private (Class C) range. The subnet 192.168.1.0/24 spans 256 total addresses.
  • Hosts on this subnet can use addresses from 192.168.1.1 through 192.168.1.254 (254 usable).
  • The network address (192.168.1.0) and broadcast address (192.168.1.255) are reserved and cannot be assigned to devices.
  • Increasing the prefix by 1 (/25) would halve the subnet to 126 usable hosts.

Next stepPrivate addresses are never routed on the public internet. Use NAT if devices on this subnet need internet access.

What is a subnet and why does it matter?

A subnet (short for subnetwork) is a logical division of an IP network. Subnetting lets network administrators break a large address block into smaller, isolated segments, reducing broadcast traffic, improving security, and making routing more efficient. Every device on the same subnet can communicate directly without going through a router. Devices on different subnets must pass traffic through a gateway, which is why correct subnet design is fundamental to network planning.

How CIDR notation and subnet masks work

Classless Inter-Domain Routing (CIDR) uses a slash suffix to indicate how many leading bits of an IPv4 address belong to the network. For example, 192.168.1.0/24 means the first 24 bits are the network part and the remaining 8 bits identify individual hosts. The equivalent subnet mask is 255.255.255.0, written in dotted-decimal by treating each group of 8 bits separately. To find the network address, perform a bitwise AND between the IP address and the subnet mask. To find the broadcast address, perform a bitwise OR between the network address and the wildcard mask (the bitwise inverse of the subnet mask). Every address between those two endpoints belongs to the subnet.

Network address, broadcast address, and usable hosts

The first address in every subnet is the network address and represents the subnet itself - it cannot be assigned to a device. The last address is the broadcast address, which every device on the subnet listens to and which also cannot be assigned. Everything between them is the usable host range. For a /24, that means 256 total addresses minus 2 reserved = 254 usable. For a /30 (used on WAN point-to-point links), 4 total addresses minus 2 = only 2 usable hosts. The formula for usable hosts is: 2 raised to the number of host bits, minus 2. Exception: /31 networks used on point-to-point links under RFC 3021 drop the network and broadcast convention and allow both addresses to be used.

Wildcard masks and their use in ACLs

A wildcard mask is the bitwise complement of the subnet mask: every 1 in the subnet mask becomes a 0, and every 0 becomes a 1. Wildcard masks are used in Cisco ACL (access control list) statements and in OSPF area definitions to specify which addresses a rule matches. A 0 bit in the wildcard mask means "this bit must match," and a 1 bit means "ignore this bit." For example, a wildcard mask of 0.0.0.255 paired with the network address 192.168.1.0 matches any address in the range 192.168.1.0 through 192.168.1.255 - the same range as a /24 subnet.

IPv4 address classes and private ranges

Before CIDR, IPv4 used fixed classes: Class A (1.0.0.0 to 126.255.255.255) with a /8 default, Class B (128.0.0.0 to 191.255.255.255) with a /16 default, and Class C (192.0.0.0 to 223.255.255.255) with a /24 default. RFC 1918 reserves three private ranges that are not routed on the public internet: 10.0.0.0/8 (Class A), 172.16.0.0/12 (Class B range), and 192.168.0.0/16 (Class C range). Most home and office networks use RFC 1918 addresses with NAT to share a single public IP.

IPv4 CIDR prefix reference

PrefixSubnet MaskTotal AddressesUsable HostsCommon Use
/8255.0.0.016,777,21616,777,214Class A private (10.0.0.0/8)
/16255.255.0.065,53665,534Class B private (172.16.0.0/12 range)
/20255.255.240.04,0964,094Mid-size office LAN
/22255.255.252.01,0241,022Campus building segment
/24255.255.255.0256254Standard home or small office LAN
/25255.255.255.128128126Splitting a /24 into two halves
/26255.255.255.1926462Small workgroup or Wi-Fi segment
/27255.255.255.2243230Small team or device group
/28255.255.255.2401614Small office or switch segment
/29255.255.255.24886Server cluster or DMZ
/30255.255.255.25242WAN point-to-point link
/31255.255.255.25422 (RFC 3021)Point-to-point (no broadcast)
/32255.255.255.25511Host route (single device)

Common subnet sizes used in network design. Usable hosts = total addresses minus the network and broadcast addresses.

Frequently asked questions

What is the difference between a subnet mask and a wildcard mask?

A subnet mask marks which bits of an IP address belong to the network (bits set to 1) and which belong to the host (bits set to 0). A wildcard mask is the exact bitwise inverse: 0 bits indicate a must-match position and 1 bits indicate a do-not-care position. Subnet masks are used to define subnets; wildcard masks are used in router ACL rules and routing protocol configurations such as OSPF.

How do I find the network address from an IP address and prefix?

Perform a bitwise AND between the IP address and the subnet mask. For example, given 192.168.1.100 and /24 (mask 255.255.255.0): 192.168.1.100 AND 255.255.255.0 = 192.168.1.0. The result is always the lowest address in the subnet and identifies the subnet itself.

How many usable hosts does a /24 subnet have?

A /24 subnet has 24 network bits and 8 host bits, giving 2^8 = 256 total addresses. Subtracting the network address and the broadcast address leaves 254 usable host addresses. The subnet mask is 255.255.255.0 and the wildcard mask is 0.0.0.255.

What is a /30 subnet used for?

A /30 subnet has exactly 4 addresses: one network address, two usable host addresses, and one broadcast address. This makes it ideal for point-to-point WAN links between two routers, where only two endpoints need addressing and wasting a larger block would be inefficient.

What is a /31 subnet and how is it different?

A /31 subnet normally would have only 2 addresses with no usable hosts (both the network and broadcast would be reserved). RFC 3021 allows an exception: on numbered point-to-point links, a /31 pair may use both addresses as host addresses, eliminating the need for network and broadcast designations. This saves one extra IP compared to a /30.

What does /32 mean in an IP address?

A /32 is a host route - it represents exactly one specific IP address with no range at all. The network address and the host address are the same. /32 routes appear in routing tables to direct traffic to a single specific device, such as a loopback interface or a virtual IP.

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

Each time you increase the prefix length by 1, you halve the available host space and double the number of subnets. A /24 can become two /25 subnets (126 hosts each), four /26 subnets (62 hosts each), eight /27 subnets (30 hosts each), and so on. This is called Variable Length Subnet Masking (VLSM) and lets you size each subnet to fit the number of devices it needs to serve.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…