Subnet Calculator

IPv4 Address

Loading...

Results

IPv4 Subnet Information
Network Visualization
Subnet Enumeration (Max 256 displayed)
Network Address Usable Host Range Broadcast Address

A subnet calculator automates the division of a single IP network into multiple smaller, distinct broadcast domains. This tool computes network addresses, broadcast addresses, and usable host ranges based on an input IP address and a subnet mask or CIDR prefix. Its purpose is to eliminate manual binary calculations, reduce human error in IP address planning, and ensure efficient allocation of a finite address space. Network engineers use these calculators to design subnetworks for departments, VLANs, or security zones, define routing boundaries, and prevent IP address conflicts within enterprise, cloud, and internet service provider environments.

A subnet calculator operates on the logical principles of bitwise AND operations and binary place value. Every IP address comprises two components: a network prefix and a host identifier. The subnet mask, a string of consecutive binary 1s followed by 0s, defines the boundary between these components. Bits set to 1 in the mask correspond to the network portion; bits set to 0 correspond to the host portion. Classless Inter-Domain Routing notation condenses this mask into a single number following a slash, such as /24, indicating the count of network bits. The calculator processes the input IP address and mask, performing a bitwise AND to derive the network address—the first address in the block. It then determines the broadcast address by setting all host bits to 1. All addresses between the network and broadcast addresses are usable host addresses, excluding those two reserved endpoints.

IPv4 subnetting fundamentals begin with the 32-bit address format, typically shown as four dotted-decimal octets. Each octet represents eight bits, with values from 0 to 255. The core task is borrowing bits from the host portion to create more networks, reducing the number of hosts per network. IPv6 subnetting considerations involve a 128-bit address space, represented in hexadecimal groups separated by colons. The standard subnet size for most customer allocations is a /64, which provides an enormous number of host addresses. Subnetting in IPv6 typically focuses on allocating address blocks to different network segments or tiers within an organization’s infrastructure, not on conserving addresses.

CIDR notation explained shows it is the standard method for specifying network prefixes. A CIDR block like 192.168.1.0/24 defines both the network address and the prefix length. This notation replaced the older classful system and enables variable-length subnet masking. Classful addressing designated fixed network boundaries based on the first octet of an IPv4 address, creating Class A, B, and C networks. This rigid system wasted large address blocks. Classless addressing, formalized by CIDR, allows for masks of any length, enabling precise and efficient allocation. The network address is the first address in a subnet, identifying the network itself. The broadcast address is the last address, used to send data to all hosts on that subnet. Usable hosts are all addresses between these two, assignable to interfaces like computers, routers, and printers. The total number of addresses in a subnet is calculated as 2 raised to the power of the number of host bits. Usable hosts are this total minus two for the network and broadcast addresses, except in specific edge cases.

Binary representation of IP addresses is the foundational layer for subnet calculations. The decimal address 192.168.1.0 equals 11000000.10101000.00000001.00000000 in binary. Subnet masks are also binary; 255.255.255.0 is 11111111.11111111.11111111.00000000. Subnet tables and CIDR charts are common reference aids that list prefix lengths, subnet masks, total addresses, and usable hosts. A typical chart shows that a /24 mask yields 256 total addresses with 254 usable hosts, while a /30 mask yields 4 total addresses with 2 usable hosts. VLSM concepts allow for subnets of varying sizes within the same parent network. This hierarchical and non-uniform allocation maximizes address utilization. A network could use a /25 for one large segment and several /30s for point-to-point links, all carved from a single /24 block.

Common subnet sizes and use cases follow predictable patterns. A /24 network is standard for small business or departmental LANs. A /30 or /31 is reserved for point-to-point serial or router interconnect links. A /28 might be used for a medium-sized server VLAN. A /32 represents a single host address. Private IP ranges, defined in RFC 1918, are reserved for internal networks and are not routable on the public internet. These ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Public IP addresses are globally unique and assigned by regional internet registries. Network Address Translation allows private addresses to access the internet using a public IP.

The mathematical foundation of subnetting is binary exponentiation. The formula for the total number of addresses in a subnet is 2^(h), where h represents the number of host bits. Host bits are derived by subtracting the prefix length from the total address bits. For IPv4, total address bits are 32. If the CIDR prefix is /24, then host bits equal 32 – 24 = 8. Total addresses equal 2^8 = 256. The formula for usable hosts is (2^h) – 2, which reserves one address for the network identifier and one for the broadcast identifier. This minus-two rule is a standard assumption for most subnetting operations. The network address is found by performing a logical AND between the IP address and the subnet mask. The broadcast address is calculated by taking the network address and setting all host bits to binary 1.

IPv4 CIDR Prefix Reference Chart

This table shows the relationship between CIDR prefix size, subnet masks, available host addresses, network bits, and host bits. It is highly useful when designing networks, optimizing address allocation, and calculating subnet sizes.

Prefix Size Network Mask Wildcard Mask Total Addresses Usable Hosts per Subnet Network Bits Host Bits Address Class Range
Supernet Range
/1 128.0.0.0 127.255.255.255 2,147,483,648 2,147,483,646 1 31 Supernet
/2 192.0.0.0 63.255.255.255 1,073,741,824 1,073,741,822 2 30 Supernet
/3 224.0.0.0 31.255.255.255 536,870,912 536,870,910 3 29 Supernet
/4 240.0.0.0 15.255.255.255 268,435,456 268,435,454 4 28 Supernet
/5 248.0.0.0 7.255.255.255 134,217,728 134,217,726 5 27 Supernet
/6 252.0.0.0 3.255.255.255 67,108,864 67,108,862 6 26 Supernet
/7 254.0.0.0 1.255.255.255 33,554,432 33,554,430 7 25 Supernet
Class A Default Network (/8)
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214 8 24 Class A Range
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606 9 23 Class A Range
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302 10 22 Class A Range
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150 11 21 Class A Range
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574 12 20 Class A Range
/13 255.248.0.0 0.7.255.255 524,288 524,286 13 19 Class A Range
/14 255.252.0.0 0.3.255.255 262,144 262,142 14 18 Class A Range
/15 255.254.0.0 0.1.255.255 131,072 131,070 15 17 Class A Range
Class B Default Network (/16)
/16 255.255.0.0 0.0.255.255 65,536 65,534 16 16 Class B Range
/17 255.255.128.0 0.0.127.255 32,768 32,766 17 15 Class B Range
/18 255.255.192.0 0.0.63.255 16,384 16,382 18 14 Class B Range
/19 255.255.224.0 0.0.31.255 8,192 8,190 19 13 Class B Range
/20 255.255.240.0 0.0.15.255 4,096 4,094 20 12 Class B Range
/21 255.255.248.0 0.0.7.255 2,048 2,046 21 11 Class B Range
/22 255.255.252.0 0.0.3.255 1,024 1,022 22 10 Class B Range
/23 255.255.254.0 0.0.1.255 512 510 23 9 Class B Range
Class C Default Network (/24)
/24 255.255.255.0 0.0.0.255 256 254 24 8 Class C Range
/25 255.255.255.128 0.0.0.127 128 126 25 7 Class C Range
/26 255.255.255.192 0.0.0.63 64 62 26 6 Class C Range
/27 255.255.255.224 0.0.0.31 32 30 27 5 Class C Range
/28 255.255.255.240 0.0.0.15 16 14 28 4 Class C Range
/29 255.255.255.248 0.0.0.7 8 6 29 3 Class C Range
/30 255.255.255.252 0.0.0.3 4 2 30 2 Class C Range
/31 255.255.255.254 0.0.0.1 2 0* 31 1 Class C Range
/32 255.255.255.255 0.0.0.0 1 0* 32 0 Class C Range
Understanding Subnet Terms
  • Prefix Size (CIDR): Number of bits used for the network portion.
  • Network Mask: Decimal representation of the subnet mask.
  • Wildcard Mask: Inverse of the subnet mask, commonly used in routing and ACLs.
  • Total Addresses: Total IP addresses available in the subnet.
  • Usable Hosts: Assignable host addresses after excluding network and broadcast addresses.
  • /31 Networks: Commonly used for point-to-point links under RFC 3021.
  • /32 Networks: Represents a single host address.
  • Class A: Default prefix /8.
  • Class B: Default prefix /16.
  • Class C: Default prefix /24.

Using the Subnet Calculator – Accurate Steps

  1. Enter the IP Address in the dotted-decimal format (IPv4) or colon-separated format (IPv6).
  2. Provide the Subnet Mask in dotted-decimal format or CIDR prefix (e.g., /24). Only one is required.
  3. Optionally, specify the number of required hosts to determine minimum subnet size.
  4. Click the "Calculate" button to generate results.
  5. Review the results section, including network address, broadcast address, total IPs, usable hosts, first and last usable IPs, and wildcard mask.
  6. Click "Reset" to clear inputs and start a new calculation.

Interpreting Calculator Results

Interpreting calculator results requires understanding each output field. The provided IP address is the original input. The network address is the base of the subnet range. The broadcast address is the top of the range. The subnet mask and CIDR prefix are equivalent representations of the network boundary. The total number of IP addresses includes all reserved addresses. The number of usable hosts typically deducts the network and broadcast addresses. The first usable IP is the network address plus one. The last usable IP is the broadcast address minus one. The IP address range displays the complete span from network to broadcast. A wildcard mask, used in access control lists, is the inverse of the subnet mask. Common misunderstandings involve applying the usable host count to all scenarios. Point-to-point links using a /31 subnet do not have distinct network and broadcast addresses, making both addresses usable.

Practical Examples

A practical example involves planning a new office network. The assigned address block is 10.10.0.0/21. This block must be subdivided for various departments. The calculator shows the base network 10.10.0.0, a mask of 255.255.248.0, and 2046 usable hosts across the entire /21. The IT team needs a server VLAN with around 100 hosts. A /25 subnet provides 126 usable hosts. The calculator input 10.10.0.0/25 yields a network address of 10.10.0.0, a broadcast of 10.10.0.127, and a usable range from 10.10.0.1 to 10.10.0.126. The sales department needs a smaller wireless network for 50 devices. A /26 subnet provides 62 usable hosts. Using VLSM, the next available address block after the /25 is 10.10.0.128. Inputting 10.10.0.128/26 gives a network of 10.10.0.128, a broadcast of 10.10.0.191, and a usable range from 10.10.0.129 to 10.10.0.190.

Another example configures a wide area network link between two routers. The link requires only two IP addresses, one for each router interface. A /30 subnet provides two usable hosts. For the block 192.168.100.0/24, the first /30 is 192.168.100.0/30. The calculator shows a network address of 192.168.100.0, a broadcast of 192.168.100.3, and usable IPs of 192.168.100.1 and 192.168.100.2. More efficiently, a /31 subnet can be used for point-to-point links as per RFC 3021. A /31 has no traditional network or broadcast address, so both addresses are usable. The subnet 192.168.100.4/31 yields two usable addresses: 192.168.100.4 and 192.168.100.5.

Limitations of Subnet Calculators

Subnet calculators assume standard IPv4 and IPv6 addressing rules, which introduce specific limitations. They cannot detect subnet overlaps within a broader address plan unless specifically designed as a VLSM planner. Manual verification is necessary to ensure new subnets do not conflict with existing allocations. IPv4 address exhaustion is a practical constraint; calculators only perform mathematical operations, not address availability checks. The /31 and /32 subnets are edge cases. A /31 prefix uses the two-address block for point-to-point links, violating the standard minus-two rule. A /32 prefix defines a single host route with no broadcast domain. IPv6 subnetting typically uses a /64 prefix for most networks, as many IPv6 features like stateless address autoconfiguration require it. Using prefixes longer than /64 for general end-user networks can break these protocols.

Privacy Considerations

Privacy considerations for web-based subnet calculators are minimal but relevant. Reputable calculators perform computations locally within the user's browser using JavaScript, transmitting no IP address data to external servers. Users should verify the tool operates client-side if handling sensitive internal IP schemes. Network diagrams or plans containing real IP addresses should never be uploaded to untrusted web tools. Security implications stem from subnet planning errors, not the calculator itself. Misconfigured subnet masks can expose internal hosts by making them routable. Overlapping subnets cause persistent connectivity issues and are difficult to diagnose. Incorrectly sized subnets lead to premature address exhaustion or wasteful allocation.

Frequently Asked Questions

What is a subnet calculator?

A subnet calculator is a software tool that performs the binary mathematics required to divide an IP network address space into smaller subnetworks, outputting the resulting network address, broadcast address, and range of usable host addresses.

How does CIDR notation relate to a subnet mask?

CIDR notation expresses the subnet mask as a suffix following a slash. The number indicates the count of consecutive 1 bits in the mask. A /24 CIDR prefix is equivalent to the subnet mask 255.255.255.0.

Why do we subtract two addresses when calculating usable hosts?

In standard IPv4 subnetting, the first address in a subnet is reserved as the network identifier, and the last address is reserved as the broadcast address. These two addresses cannot be assigned to host devices, leaving the remaining addresses for use.

What is the difference between a network address and a broadcast address?

The network address identifies the subnet itself and is used in routing tables. The broadcast address is used to send data packets to every host on that specific subnet simultaneously.

Can a subnet calculator help prevent IP address conflicts?

Yes, by accurately determining the exact range of addresses within a planned subnet, a calculator helps network administrators ensure new address allocations do not overlap with existing subnets, preventing conflicts.

What are /31 and /32 subnets used for?

A /31 subnet provides two addresses and is used for point-to-point network links between two devices, as defined in RFC 3021. A /32 subnet defines a single host route, often used for loopback interfaces or specific host routing entries.

How is IPv6 subnetting different from IPv4 subnetting?

IPv6 uses a 128-bit address space, making conservation less critical. The standard subnet size is a /64, which provides an exceedingly large number of addresses. Subnetting in IPv6 is more about hierarchical network organization than maximizing address utilization.

What is VLSM and why is it important?

Variable Length Subnet Masking allows different subnets within the same network to have different sizes. This maximizes address efficiency by allowing precise allocation, such as using a large subnet for a user VLAN and small /30 subnets for router interconnects.

What does the wildcard mask represent in the calculator results?

The wildcard mask is the inverse of the subnet mask. It is used in access control lists and routing protocol configurations to indicate which bits in an IP address should be examined. If a subnet mask is 255.255.255.0, the wildcard mask is 0.0.0.255.

Are the results from online subnet calculators always accurate?

The mathematical results for standard subnets are accurate if the tool is correctly programmed. However, the tool cannot assess whether the calculated subnet overlaps with others in your network or if it is a valid allocation from your internet service provider.