🌐 Online IP Subnet Calculator

Ad Space - Top (728Γ—90)

Enter IP Address and Subnet Mask

Ad Space - Middle (728Γ—90)

How to Use

The IP subnet calculator is an essential tool for network engineers, system administrators, and web developers. Here is a detailed guide:

Basic Operation: Enter a valid IPv4 address in the input field (e.g., 192.168.1.1), then select the subnet size from the CIDR prefix dropdown (e.g., /24). Click the "Calculate Subnet" button, and the tool will instantly compute all key subnet information, including network address, broadcast address, usable IP range, subnet mask, and number of usable hosts. All calculations are performed locally in your browser; no data is uploaded to any server.

CIDR Prefix Selection: CIDR (Classless Inter-Domain Routing) prefix indicates the number of leading 1 bits in the subnet mask. /24 is the most common LAN subnet (mask 255.255.255.0, 254 usable hosts). /30 is typically used for point-to-point links (only 2 usable hosts). /32 represents a single host address. The tool provides quick buttons for common CIDR values, or you can select from the dropdown menu.

Interpreting Results: Results are displayed as cards, each containing a key piece of information. The network address is the start of the subnet, and the broadcast address is the end of the subnet. The usable IP range excludes these two reserved addresses. The IP class is automatically determined by the first byte range (A/B/C/D/E), and the tool also indicates whether the IP is private or public.

Binary Display: The bottom of the results shows the binary representation of the IP address, with network bits highlighted in cyan and host bits in green. This helps you visually understand how the subnet mask divides the IP address into network and host portions.

Use Cases

IP subnet calculation has wide applications across multiple fields. Here are several typical scenarios:

Enterprise Network Planning: When designing a network topology for a company, network engineers need to allocate subnets based on department sizes and device counts. For example, an admin department has 50 devices, R&D has 120, and the server zone has 20. Using the subnet calculator, engineers can quickly determine the required CIDR prefix for each department: /26 (62 hosts) for admin, /25 (126 hosts) for R&D, and /27 (30 hosts) for servers, enabling efficient address allocation.

Cloud Environment Configuration: On platforms like AWS, Azure, and Alibaba Cloud, creating a VPC (Virtual Private Cloud) requires specifying a CIDR block. The subnet calculator helps developers verify whether the chosen CIDR range meets business needs, avoiding IP shortage or waste. For example, a /16 VPC provides 65,534 available addresses, enough for thousands of instances and multiple subnets.

Network Security Policy: Firewall rules, ACLs (Access Control Lists), and security group policies are often based on subnets. Using the subnet calculator, security administrators can accurately determine which IP addresses belong to the same subnet, enabling more precise access rules. For example, allowing the 192.168.10.0/24 subnet to access the database server while denying all other subnets.

Extended Knowledge

History of CIDR: Before CIDR, IP addresses used fixed A/B/C class allocation, leading to severe address space waste. CIDR, introduced in 1993, broke the fixed class limitations by allowing arbitrary prefix lengths, dramatically improving IPv4 address utilization. CIDR notation combines the IP address and subnet mask into a single "address/prefix length" format, such as 192.168.1.0/24.

Subnet Division Principle: A subnet mask is a 32-bit binary number where network bits are set to 1 and host bits to 0. Performing a bitwise AND between the IP address and the subnet mask yields the network address. For example, IP address 192.168.1.100 (binary 11000000.10101000.00000001.01100100) ANDed with mask 255.255.255.0 (/24) results in 192.168.1.0, the network address of the subnet.

IPv6 Subnets: While this tool focuses on IPv4, IPv6 subnetting follows the same principles. IPv6 addresses are 128 bits, and /64 is typically used as the standard subnet prefix (analogous to /24 in IPv4). Each /64 subnet provides 2^64 addresses, an extremely generous address space. IPv6 was designed without NAT (Network Address Translation), allowing each device to have a unique public address.

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) is a compact way to represent an IP address and its subnet mask. For example, 192.168.1.0/24 means the IP address is 192.168.1.0 with the first 24 bits of the subnet mask set to 1 (i.e., 255.255.255.0). The number after the slash is called the prefix length, ranging from 0 to 32.

What is the purpose of a subnet mask?

A subnet mask divides an IP address into a network portion and a host portion. By performing a bitwise AND with the IP address, you get the network address. The number of 1 bits in the mask determines the network size; for example, a /24 mask allows 254 usable host addresses.

What are the private IP address ranges?

RFC 1918 defines three classes of private IP address ranges: Class A 10.0.0.0/8 (10.0.0.0-10.255.255.255), Class B 172.16.0.0/12 (172.16.0.0-172.31.255.255), and Class C 192.168.0.0/16 (192.168.0.0-192.168.255.255). These addresses are used only within local networks and cannot be routed on the public Internet.

Why subtract 2 from the total host count?

In a subnet, the network address (first address) and the broadcast address (last address) are reserved and cannot be assigned to hosts. The network address identifies the entire subnet, while the broadcast address is used to send data to all hosts within the subnet. Therefore, usable hosts equal total addresses minus 2.

What are the IP address classes?

IPv4 addresses are divided into five classes by the first byte range: Class A (1-126, large networks), Class B (128-191, medium networks), Class C (192-223, small networks), Class D (224-239, multicast), and Class E (240-255, experimental/reserved). The 127.0.0.0/8 range is reserved for loopback.

What is the difference between /30 and /31 subnets?

A /30 subnet has 4 addresses (2 usable hosts) and is commonly used for point-to-point links between two interfaces. A /31 subnet has only 2 addresses (0 usable hosts). RFC 3021 permits using /31 on point-to-point links to conserve IPv4 address space, supported by most modern routers. /32 represents a single host address.

What is VLSM?

VLSM (Variable Length Subnet Masking) allows different subnet mask sizes within the same network, enabling more flexible address allocation. For example, within a /24 network, you might allocate a /26 (64 addresses) for the office area and a /28 (16 addresses) for the server area, improving address utilization.

Ad Space - Bottom (728Γ—90)