Skip to content
UtilHQ

Subnet Calculator

Calculate subnet details for any IPv4 address and CIDR prefix instantly.

100% Free No Data Stored Instant
Network Address
192.168.1.0
Broadcast Address
192.168.1.255
First Usable Host
192.168.1.1
Last Usable Host
192.168.1.254
Total IP Addresses
256
Usable Host Addresses
254
Subnet Mask
255.255.255.0
Wildcard Mask
0.0.0.255
Binary Mask Visualizationtext
Subnet Mask:    11111111.11111111.11111111.00000000
Dotted Decimal: 255.255.255.0
Wildcard Mask:  0.0.0.255
CIDR Notation:  /24

Network bits:   NNNNNNNNNNNNNNNNNNNNNNNNHHHHHHHH
                11111111.11111111.11111111.00000000

N = Network bit (fixed)
H = Host bit (variable)

CIDR Quick Reference

CIDRSubnet MaskTotal IPsUsableTypical Use
/32255.255.255.25510Single host
/30255.255.255.25242Point-to-point link
/28255.255.255.2401614Small office
/24255.255.255.0256254Standard LAN
/20255.255.240.04,0964,094Campus network
/16255.255.0.065,53665,534Large organization
/12255.240.0.01,048,5761,048,574ISP allocation
/8255.0.0.016,777,21616,777,214Class A block
Ad Space
Ad Space

Share this tool

About This Tool

Calculate subnet details for any IPv4 address and CIDR prefix instantly. Enter an IP address, select a CIDR prefix length from /8 to /30, and this tool computes the network address, broadcast address, usable host range, total IP count, subnet mask in dotted-decimal format, wildcard mask, and a binary mask visualization showing exactly which bits belong to the network vs. host portion. Subnetting is a foundational skill for network engineers, system administrators, and anyone working with IP networking. Splitting a large network into smaller subnets improves security through segmentation, reduces broadcast traffic, and makes IP address allocation more efficient. Before deploying servers, configuring firewalls, or setting up VPNs, you need to know the exact address ranges for each subnet. This calculator handles all the bitwise math for you. Rather than manually converting between binary and decimal or counting host bits on paper, enter your starting IP and desired prefix length, and the results appear instantly. The binary visualization helps you understand the underlying structure, making this tool useful for both learning and production network planning.

How Subnet Calculation Works

Every IPv4 address is a 32-bit number divided into a network portion and a host portion. The CIDR prefix (e.g., /24) tells you how many bits belong to the network. A /24 means the first 24 bits are the network identifier and the remaining 8 bits identify individual hosts on that network. The subnet mask is created by setting the network bits to 1 and the host bits to 0, then converting to dotted-decimal notation. For /24, the binary mask is 11111111.11111111.11111111.00000000, which equals 255.255.255.0. The network address is obtained by ANDing the IP with the mask, and the broadcast address is obtained by ORing the IP with the inverted mask (wildcard).

Network vs. Broadcast vs. Usable Addresses

In any subnet, the first address is the network address (all host bits set to 0) and the last address is the broadcast address (all host bits set to 1). Neither can be assigned to a device. The usable host range is everything between these two addresses. For a /24 subnet with 256 total IPs, you get 254 usable host addresses. For a /30 subnet (commonly used for point-to-point links between routers), you get only 4 total IPs and 2 usable addresses. For /31 and /32, special rules apply per RFC 3021, allowing point-to-point links without wasting addresses on network and broadcast.

Wildcard Masks and Access Control Lists

The wildcard mask is the bitwise inverse of the subnet mask. Where the subnet mask has 1s, the wildcard has 0s, and vice versa. Wildcard masks are used extensively in Cisco IOS access control lists (ACLs) and OSPF network statements. For a /24 subnet with mask 255.255.255.0, the wildcard mask is 0.0.0.255. This tells the router "match the first three octets exactly, and allow any value in the fourth octet." Understanding wildcard masks is essential for writing firewall rules and configuring routing protocols.

Common Subnetting Scenarios

Home networks typically use /24 (254 usable hosts). Small offices may need /22 or /23 for multiple VLANs. Cloud providers like AWS assign /16 VPCs by default (65,534 usable IPs) and let you create smaller subnets within them. Data center spine-leaf architectures use /31 point-to-point links between switches. When planning subnets, always account for growth: if you need 50 hosts today, a /26 (62 usable) leaves minimal room, while a /25 (126 usable) provides comfortable expansion space.

Frequently Asked Questions

What is the difference between CIDR and subnet mask notation?

They express the same information in different formats. CIDR notation appends a slash and the number of network bits to the IP address (e.g., 192.168.1.0/24). Subnet mask notation writes the mask as a dotted-decimal number (e.g., 255.255.255.0). A /24 equals 255.255.255.0, a /16 equals 255.255.0.0, and a /8 equals 255.0.0.0. CIDR notation is more compact and is the modern standard, while dotted-decimal masks are still used in many operating system and router configurations.

How many usable hosts does each CIDR prefix provide?

The formula is 2^(32 - CIDR) - 2 for usable hosts. You subtract 2 because the network address and broadcast address cannot be assigned to devices. So /24 gives 254 hosts, /25 gives 126, /26 gives 62, /27 gives 30, /28 gives 14, /29 gives 6, and /30 gives 2. The special case /31 provides 2 usable addresses with no broadcast (per RFC 3021), and /32 represents a single host address.

Why would I use a /30 or /31 subnet?

/30 subnets provide exactly 2 usable host addresses, which is ideal for point-to-point links between two routers or switches. There is no need for more addresses on a link that only connects two devices. /31 subnets (defined in RFC 3021) are even more efficient, providing 2 addresses with no network or broadcast address wasted. Many modern routers support /31 on point-to-point interfaces, saving IP address space in large networks with hundreds of inter-router links.

What are the private IP address ranges?

RFC 1918 defines three private address ranges that are not routed on the public internet: 10.0.0.0/8 (16.7 million addresses), 172.16.0.0/12 (1 million addresses), and 192.168.0.0/16 (65,536 addresses). These are used for internal networks, home routers, corporate LANs, and cloud VPCs. You can subnet these ranges freely within your organization. Additionally, 169.254.0.0/16 is reserved for link-local addressing (APIPA) when no DHCP server is available.

How do I divide a network into equal subnets?

To split a network into N equal subnets, calculate the number of additional bits needed: ceil(log2(N)). For example, splitting a /24 into 4 subnets requires 2 additional bits (2^2 = 4), creating four /26 subnets. A /24 (192.168.1.0) becomes: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, and 192.168.1.192/26. Each /26 subnet has 62 usable host addresses. You can use this calculator to verify each resulting subnet's address ranges.

U

Reviewed by the UtilHQ Team

Our tools are verified for accuracy. Results are estimates for planning purposes.