myipstats.com

Subnet Calculator

Enter IP Address and Subnet

Network Information
Network Address
-
Broadcast Address
-
Subnet Mask
-
Wildcard Mask
-
CIDR Notation
-
IP Class
-
Host Information
Total Hosts
-
Usable Hosts
-
First Usable IP
-
Last Usable IP
-
Binary Representation
IP Address:
-
Subnet Mask:
-
Network Address:
-
Subnet Division Guide

If you need to divide this network into smaller subnets:

Subnets CIDR Subnet Mask Hosts per Subnet

Use our free subnet calculator to instantly calculate network addresses, broadcast addresses, subnet masks, and usable host ranges for any IPv4 network. This essential networking tool helps NOC technicians, network engineers, and system administrators plan IP addressing schemes, troubleshoot routing issues, and design efficient network topologies. Calculate CIDR notation, determine available host counts, and visualize binary representations of IP addresses and subnet masks—all processed instantly in your browser with complete privacy.

What Is a Subnet Calculator?

A subnet calculator is a tool that performs CIDR (Classless Inter-Domain Routing) calculations to determine network parameters from an IP address and subnet mask. Given an IP address like 192.168.1.0 and a subnet mask like /24, the calculator computes the network address, broadcast address, usable host range, and total number of available IP addresses. These calculations are fundamental to IP network design and troubleshooting.

Network engineers use subnet calculators daily when planning network architectures, configuring routers and firewalls, troubleshooting connectivity issues, and documenting network infrastructure. Manual subnet calculations are error-prone and time-consuming—a calculator provides instant, accurate results and helps visualize how IP addressing works at the binary level.

Understanding CIDR Notation

CIDR notation expresses an IP address and its associated network prefix length in a compact format: 192.168.1.0/24. The number after the slash (/) indicates how many bits of the IP address represent the network portion. In this example, /24 means the first 24 bits identify the network, leaving 8 bits for host addresses within that network.

CIDR replaced the older classful networking system (Class A, B, C) in the 1990s, allowing more efficient IP address allocation. Instead of being limited to fixed network sizes, CIDR permits any prefix length from /8 to /32, enabling precise control over network size. A /28 network provides 16 IP addresses, while a /22 network provides 1,024 addresses—flexibility that classful addressing couldn't offer.

Key Subnet Components Explained

Network Address

The network address is the first IP address in a subnet and identifies the network itself. All host bits are set to zero. For example, in 192.168.1.0/24, the network address is 192.168.1.0. This address cannot be assigned to a host device—it's reserved for identifying the network in routing tables and network documentation.

Broadcast Address

The broadcast address is the last IP address in a subnet, with all host bits set to one. For 192.168.1.0/24, the broadcast address is 192.168.1.255. Packets sent to this address are delivered to all hosts on the subnet. Like the network address, the broadcast address cannot be assigned to an individual host.

Subnet Mask

The subnet mask is a 32-bit number that separates the network portion of an IP address from the host portion. Written in dotted decimal notation (e.g., 255.255.255.0), it consists of consecutive 1 bits for the network portion followed by 0 bits for the host portion. A /24 mask is 255.255.255.0 in decimal, representing 11111111.11111111.11111111.00000000 in binary.

Wildcard Mask

The wildcard mask is the inverse of the subnet mask—0 bits where the subnet mask has 1 bits, and vice versa. For a 255.255.255.0 subnet mask, the wildcard mask is 0.0.0.255. Wildcard masks are used in router ACLs (Access Control Lists) and OSPF network statements. Think of them as indicating which bits to "ignore" when matching addresses.

Usable Host Range

The usable host range consists of all IP addresses between the network and broadcast addresses. For 192.168.1.0/24, usable hosts range from 192.168.1.1 to 192.168.1.254—254 addresses that can be assigned to devices. The total number of addresses in a subnet is 2^(host bits), minus 2 for the network and broadcast addresses.

Common Subnet Sizes and Use Cases

/24 Networks (256 addresses, 254 usable hosts)

The /24 subnet is the default for small office and home networks. It provides enough addresses for typical departments or small businesses while being easy to remember and manage. Example: 192.168.1.0/24 provides 192.168.1.1 through 192.168.1.254 for devices.

/30 Networks (4 addresses, 2 usable hosts)

Point-to-point links between routers typically use /30 subnets. With only 2 usable addresses, they're perfect for connecting two routers without wasting IP space. Example: 10.0.0.0/30 provides 10.0.0.1 and 10.0.0.2 for the two router interfaces.

/31 Networks (2 addresses, 2 usable hosts)

RFC 3021 allows /31 subnets for point-to-point links, eliminating the waste of network and broadcast addresses. Both addresses are usable. This is common in modern router-to-router connections. Example: 10.0.0.0/31 provides 10.0.0.0 and 10.0.0.1.

/22 Networks (1,024 addresses, 1,022 usable hosts)

Medium-sized networks like large departments or small data centers often use /22 subnets. They provide enough address space for growth without being wastefully large. Example: 10.1.0.0/22 spans 10.1.0.1 through 10.1.3.254.

/8, /16 Networks (Large private ranges)

The RFC 1918 private address ranges use these large subnets: 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). Large enterprises subdivide these into smaller subnets for different locations, VLANs, or purposes.

IP Address Classes (Historical Context)

Before CIDR, IP addresses were divided into classes based on the first octet:

  • Class A: 1-126 (first octet) - Default mask /8 - Designed for very large networks
  • Class B: 128-191 (first octet) - Default mask /16 - Medium-sized networks
  • Class C: 192-223 (first octet) - Default mask /24 - Small networks
  • Class D: 224-239 (first octet) - Reserved for multicast
  • Class E: 240-255 (first octet) - Reserved for experimental use

While classful networking is obsolete, understanding IP classes helps when working with legacy systems or studying networking history. Modern networks use CIDR exclusively, allowing any prefix length regardless of the IP address range.

Subnetting Best Practices

When designing IP addressing schemes, plan for growth by allocating larger subnets than currently needed. If a department has 50 devices today, don't use a /26 (62 hosts)—use a /24 (254 hosts) to accommodate expansion. Running out of IP addresses in a subnet requires renumbering, which is disruptive and time-consuming.

Use hierarchical addressing to simplify routing. For example, if 10.0.0.0/16 is allocated to a building, assign 10.0.1.0/24 to the first floor, 10.0.2.0/24 to the second floor, etc. This logical structure makes troubleshooting intuitive and allows route summarization in routing protocols.

Document your subnetting scheme thoroughly. Maintain a spreadsheet or IPAM (IP Address Management) system showing which subnets are assigned to which locations, VLANs, or purposes. Without documentation, understanding a complex network becomes nearly impossible, especially during emergencies.

Reserve the first usable IP in each subnet for the gateway (router interface). This convention (e.g., 192.168.1.1 as the gateway in 192.168.1.0/24) is widely followed and helps technicians quickly identify gateway addresses without consulting documentation.

Variable Length Subnet Masking (VLSM)

VLSM allows using different subnet mask lengths within the same major network. Instead of dividing 10.0.0.0/16 into uniform /24 subnets, you can create /24 subnets for large departments, /26 subnets for small groups, and /30 subnets for point-to-point links. This maximizes efficiency by matching subnet sizes to actual requirements.

VLSM requires careful planning to avoid overlapping subnets. When subdividing a larger block, allocate the bigger subnets first, then fill in smaller ones. For example, from 10.0.0.0/22 you might allocate 10.0.0.0/24 and 10.0.1.0/24 for departments, then use 10.0.2.0/28, 10.0.2.16/28, etc. for smaller needs.

Subnet Aggregation and Route Summarization

Multiple contiguous subnets can be aggregated into a single, larger route—called route summarization or supernetting. If you have 10.0.0.0/24, 10.0.1.0/24, 10.0.2.0/24, and 10.0.3.0/24, these can be summarized as 10.0.0.0/22. Routers advertise the summary route instead of individual subnets, reducing routing table size and improving performance.

Aggregation only works when subnets are properly aligned. The starting address must be divisible by the size of the summarized block. A subnet calculator helps verify whether multiple subnets can be summarized and determines the correct summary address.

Private vs Public IP Addresses

Private IP addresses defined by RFC 1918 are used within internal networks and not routed on the public internet:

  • 10.0.0.0/8 (10.0.0.0 - 10.255.255.255)
  • 172.16.0.0/12 (172.16.0.0 - 172.31.255.255)
  • 192.168.0.0/16 (192.168.0.0 - 192.168.255.255)

Public IP addresses are globally unique and routable on the internet. Organizations obtain public IPs from Regional Internet Registries or ISPs. Most networks use NAT (Network Address Translation) to allow many private IPs to share a few public IPs for internet access.

Common Subnetting Mistakes

Overlapping subnets cause routing problems and connectivity failures. If you assign 10.1.0.0/23 to one VLAN and 10.1.1.0/24 to another, these overlap—10.1.1.0/24 is entirely contained within 10.1.0.0/23. Always verify that new subnet allocations don't overlap existing ones.

Forgetting to account for network and broadcast addresses is a common error. A /29 subnet has 8 total addresses but only 6 usable for hosts. When calculating requirements, remember that you lose 2 addresses per subnet (except in /31 point-to-point links).

Misunderstanding CIDR notation leads to incorrect subnet sizes. /24 is smaller than /16, not larger—the prefix length indicates how many bits are fixed for the network. A larger number means more bits for the network and fewer bits for hosts, resulting in a smaller subnet.

Using Subnet Calculators for Troubleshooting

When devices can't communicate, verifying they're in the same subnet is a critical troubleshooting step. If a device at 192.168.1.50 with mask 255.255.255.0 can't reach 192.168.2.10, they're in different subnets—traffic must route through a gateway. A subnet calculator quickly confirms whether two IPs are in the same broadcast domain.

Misconfigured subnet masks are common issues. If one device uses 255.255.255.0 and another uses 255.255.0.0 on the same physical network, they'll have different ideas about what constitutes the local subnet, causing communication failures. Subnet calculators help verify mask consistency.

Binary Representation and Bitwise Operations

Understanding IP addressing at the binary level clarifies how subnetting works. An IP address is 32 bits divided into 4 octets. The subnet mask uses bitwise AND operations with the IP address to extract the network portion. For example:

IP: 192.168.1.100 = 11000000.10101000.00000001.01100100
Mask: 255.255.255.0 = 11111111.11111111.11111111.00000000
Network: 192.168.1.0 = 11000000.10101000.00000001.00000000

The binary view shows exactly which bits identify the network and which identify the host. This understanding is essential for advanced subnetting and VLSM design.

IPv6 Subnetting

While this calculator focuses on IPv4, IPv6 subnetting follows similar principles with different scale. IPv6 uses 128-bit addresses and typical allocations are /48 for sites, /64 for subnets. The abundance of IPv6 addresses eliminates the need for NAT and allows simpler, hierarchical addressing schemes. However, IPv4 remains dominant in most networks, making IPv4 subnet calculation skills essential.

Frequently Asked Questions

What's the difference between /24 and /25 subnets?

A /24 subnet has 256 total addresses (254 usable hosts) with mask 255.255.255.0. A /25 subnet has 128 total addresses (126 usable hosts) with mask 255.255.255.128. The /25 divides a /24 network in half. Each increase in prefix length cuts the network size in half.

How do I calculate how many subnets I can create?

If you have a /22 network and need /24 subnets, you gain 2 subnet bits (24 - 22 = 2). With 2 bits, you can create 2^2 = 4 subnets. Each additional bit doubles the number of subnets: 1 bit = 2 subnets, 2 bits = 4 subnets, 3 bits = 8 subnets, etc.

Can I use the network and broadcast addresses for hosts?

Generally no—the network address (first IP) and broadcast address (last IP) are reserved and cannot be assigned to hosts. The exception is /31 subnets used for point-to-point links between routers, where RFC 3021 allows using both addresses.

What is a /32 subnet?

A /32 subnet represents a single IP address with mask 255.255.255.255. All 32 bits are network bits, leaving zero host bits. This is used in routing tables to specify exact host routes or in firewall rules to match a specific IP address.

Why doesn't my calculated subnet match my network configuration?

If you calculate a subnet for IP 192.168.1.50/24, the network address is 192.168.1.0, not 192.168.1.50. Your input IP might be a host address within the subnet. The calculator determines the actual network address by applying the subnet mask. Make sure you understand which address you're starting with—network address or host address within a network.

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

To divide a /24 into smaller subnets, increase the prefix length. For 4 equal subnets, use /26 (adds 2 bits: 2^2 = 4). For 8 subnets, use /27 (adds 3 bits: 2^3 = 8). Each subnet will have fewer host addresses. A /24 split into four /26 subnets gives you 62 usable hosts per subnet instead of 254 in the original /24.