IP Range Calculator

Instantly compute network address, broadcast address, usable IP range, subnet mask, wildcard mask, total IPs, and IP type from any IPv4 address and CIDR prefix. Includes interactive visualization and binary representation.

Enter a valid IPv4 address in dotted-decimal notation.
/
A number between 0 and 32.
or
/24 – Class C
/16 – Class B
/8 – Class A
/30 – Point-to-point
/28 – Small subnet
/23 – Supernet
/0 – Default route
Privacy first: All calculations are performed locally in your browser. No IP addresses or data are sent to any server.

What Is an IP Range Calculator?

An IP range calculator (also known as a subnet calculator or CIDR calculator) is a network engineering tool that computes the boundaries and properties of an IPv4 subnet given an IP address and a subnet mask (or CIDR prefix). It determines the network address, broadcast address, the range of usable host addresses, and other critical parameters such as the total number of IPs and the wildcard mask. This tool is indispensable for network design, troubleshooting, and capacity planning.

The calculator shown here performs all computations client-side using JavaScript, ensuring that no network data leaves your device. It supports both CIDR notation (e.g., /24) and traditional subnet mask notation (e.g., 255.255.255.0), and provides a rich visual representation of the address space.

Network Address = IP & Mask
Broadcast Address = Network Address | (~Mask)
Usable Range = [Network + 1, Broadcast − 1]

Where & is bitwise AND, | is bitwise OR, and ~ is bitwise NOT (complement).

Why Use an Interactive IP Range Calculator?

  • Network Design: Plan subnets for VLANs, data centers, and cloud environments with accurate IP allocations.
  • Troubleshooting: Quickly verify if an IP address belongs to a particular subnet, or identify broadcast and network addresses for diagnostics.
  • Education: Learn and teach subnetting with real-time visual feedback and binary representations.
  • Security Auditing: Understand the scope of a subnet for firewall rules, access control lists (ACLs), and network segmentation.
  • Automation: Integrate the underlying logic into scripts and network automation tools.

Understanding the Key Concepts

CIDR (Classless Inter-Domain Routing)

CIDR is a method for allocating IP addresses and routing IP packets. It replaced the older classful addressing system (Class A, B, C) with a more flexible approach. In CIDR, a subnet is defined by an IP address and a prefix length (e.g., 192.168.1.0/24), where the prefix length indicates the number of leading bits in the subnet mask. This system allows for efficient use of IP address space and is the foundation of modern Internet routing.

Subnet Mask

A subnet mask is a 32-bit number that divides an IP address into network and host portions. In binary, the mask consists of a contiguous block of 1s (the network bits) followed by 0s (the host bits). For example, 255.255.255.0 in binary is 11111111.11111111.11111111.00000000, indicating that the first 24 bits are the network part and the last 8 bits are the host part.

Network Address

The network address (or subnet ID) is the first address in a subnet. It is obtained by performing a bitwise AND between the IP address and the subnet mask. This address is used to identify the subnet itself and cannot be assigned to a host.

Broadcast Address

The broadcast address is the last address in a subnet. It is obtained by setting all host bits to 1 (i.e., network address OR (~mask)). Packets sent to the broadcast address are delivered to all hosts on the subnet. Like the network address, it cannot be assigned to a host.

Usable IP Range

The usable IP range is the set of addresses that can be assigned to hosts. It excludes the network address and the broadcast address. For a subnet with more than 2 IPs, the usable range is [network + 1, broadcast − 1]. For /31 and /32 subnets, special rules apply (RFC 3021).

How to Use This Tool

  1. Enter an IPv4 address in dotted-decimal notation (e.g., 192.168.1.0).
  2. Specify the subnet size using either a CIDR prefix (e.g., 24) or a subnet mask (e.g., 255.255.255.0).
  3. Click Calculate or press Enter.
  4. Review the comprehensive results, including network and broadcast addresses, usable range, binary representations, and the visual address-space diagram.
  5. Use the preset examples to quickly explore common subnet sizes.

Real-World Applications & Case Studies

Case Study: Office Network Segmentation

A medium-sized company with 200 employees needs to segment its network into three VLANs: Engineering (80 hosts), Marketing (50 hosts), and Administration (30 hosts). Using this IP range calculator, the network engineer can determine the appropriate subnet sizes. For Engineering, a /24 subnet provides 254 usable IPs — more than enough. Marketing gets a /25 (126 usable IPs), and Administration a /26 (62 usable IPs). The calculator quickly verifies that the subnets do not overlap and provides the exact network and broadcast addresses for each VLAN, streamlining the deployment of DHCP scopes and firewall rules.

Case Study: Cloud VPC Subnet Planning

When designing a Virtual Private Cloud (VPC) in AWS, Azure, or GCP, selecting the right CIDR block is critical. For a VPC with 10.0.0.0/16, an architect wants to carve out subnets for public-facing load balancers, application servers, and databases. Using this tool, they test various CIDR sizes: /24 for the public subnet (254 IPs), /23 for the application tier (510 IPs), and /25 for the database tier (126 IPs). The calculator's visual range display helps ensure there is no overlap and that each subnet has enough capacity for future growth.

Case Study: Firewall Rule Validation

A security analyst is reviewing a set of firewall ACLs that use network addresses like 192.168.5.0/28. To verify that the rules correctly cover the intended hosts, the analyst uses the IP range calculator to expand the CIDR notation into the full usable IP range. This allows them to confirm that no host is accidentally excluded and that the broadcast address is not inadvertently allowed, closing a potential security gap.

Common Mistakes and Misconceptions

  • Using the network address as a host IP: The network address (e.g., 192.168.1.0) is reserved and cannot be assigned to a device.
  • Using the broadcast address as a host IP: The broadcast address (e.g., 192.168.1.255) is reserved for sending packets to all hosts.
  • Confusing CIDR prefix with the number of usable IPs: A /24 prefix does not mean 24 usable IPs — it means 256 total IPs, of which 254 are usable.
  • Assuming all subnets have the same broadcast address: The broadcast address depends on the subnet mask. For /24 it ends in .255, but for /16 it ends in .255.255.
  • Forgetting that /31 subnets have no broadcast or network address in the traditional sense: RFC 3021 allows /31 subnets for point-to-point links, with both addresses usable as host addresses.

Technical Deep Dive: The Math Behind the Calculator

Under the hood, the IP range calculator converts the dotted-decimal IP address and mask into 32-bit unsigned integers. This is done by shifting each octet by the appropriate number of bits and summing them. The network address is computed as ip & mask (bitwise AND). The broadcast address is network | (~mask) (bitwise OR with the bitwise complement of the mask). The wildcard mask is simply ~mask (or 0.0.0.255 for a /24), and it is used in some routing protocols to specify which bits to ignore.

The total number of IPs in the subnet is 2^(32 − prefix). The number of usable IPs is total − 2 for prefix ≤ 30, 2 for /31 (both usable per RFC 3021), and 1 for /32 (a single host route).

The IP type (public or private) is determined by checking the address against the RFC 1918 private ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Additionally, the tool identifies the legacy class (A, B, C, D, or E) based on the first octet.

Frequently Asked Questions

CIDR (Classless Inter-Domain Routing) uses a prefix length (e.g., /24) to indicate the number of network bits. A subnet mask (e.g., 255.255.255.0) is the 32-bit representation of that same information. They are two ways of expressing the same thing. The calculator accepts both and converts between them automatically.

This tool is designed for IPv4 addresses only. IPv6 subnetting involves 128-bit addresses and a different notation. We recommend using a dedicated IPv6 subnet calculator for those use cases. However, the underlying principles of network and broadcast addresses (with appropriate modifications) are similar.

A wildcard mask (also called an inverse mask) is the bitwise complement of the subnet mask. It is used in some networking contexts, such as OSPF routing protocol configurations and access control lists (ACLs), to specify which bits of an IP address to match. For example, for a /24 mask (255.255.255.0), the wildcard mask is 0.0.0.255.

A /24 subnet has 2^(32−24) = 256 total addresses. The first address (network address) and the last address (broadcast address) are reserved and cannot be assigned to hosts. This leaves 254 usable addresses for devices. This rule applies to all subnets with a prefix length between 0 and 30.

A /31 subnet has only 2 addresses. Traditionally, this was not usable because the network and broadcast addresses consumed both. However, RFC 3021 allows /31 subnets for point-to-point links (e.g., router-to-router connections), where both addresses can be used as host addresses. This conserves IP address space.

The calculations use 32-bit integer arithmetic in JavaScript, which is accurate to the exact bit. All results are deterministic and mathematically precise. The tool has been tested against standard subnetting references and validated for accuracy. It is suitable for professional network engineering and academic use.

We recommend the following authoritative resources: RFC 4632 (CIDR), RFC 1918 (Private Address Space), Khan Academy — Network Layer, and the classic textbook "Computer Networking: A Top-Down Approach" by Kurose and Ross. For interactive practice, consider using subnetting practice websites and Cisco's Networking Academy.
References: RFC 4632 — CIDR; RFC 1918 — Private Addressing; RFC 3021 — /31 Subnets; IEEE Standards Association; Cisco Systems Networking Documentation.

Built on solid networking principles – This tool is based on the foundational concepts of IPv4 addressing as defined by the IETF and the IEEE. The implementation follows the bitwise operations described in RFCs 4632 and 1918. Last updated July 2026.