Subnet Mask Calculator

NameNetworkCIDRSubnet MaskUsable IP RangeBroadcastHosts

IP Base Conversion

Mask CIDR Converter

Wildcard Mask Calculator

Private IP Range Reference

ClassAddress RangeCIDRMask
Private (Class A)10.0.0.0 ~ 10.255.255.255/8255.0.0.0
Private (Class B)172.16.0.0 ~ 172.31.255.255/12255.240.0.0
Private (Class C)192.168.0.0 ~ 192.168.255.255/16255.255.0.0
Loopback127.0.0.0 ~ 127.255.255.255/8255.0.0.0
Link-Local169.254.0.0 ~ 169.254.255.255/16255.255.0.0

Features

Basic Subnet Calculation

Enter IP and CIDR/mask for real-time calculation of network address, broadcast address, usable host range, wildcard mask, IP class and private address detection

VLSM Division

Supports equal-split mode and custom VLSM division, automatically calculates each subnet's network address, mask, usable IP range and broadcast address

Supernet Route Aggregation

Input multiple networks, automatically calculates the smallest covering supernet, flags exact vs. inexact aggregation for route summarization

IP Range Check

Quickly verify whether an IP belongs to a specified network, displays detailed subnet information, assists network configuration troubleshooting

Local Real-time Processing

All calculations run locally in your browser, no server upload needed, results appear on input, protecting privacy

How to Use

1

Select Feature Module

Use the top tabs to switch to the desired function: Basic Subnet Calc, VLSM Division, Route Aggregation, IP Range Check, or Auxiliary Tools

2

Enter IP and Mask

Enter the IP address and CIDR prefix (e.g. /24) or subnet mask (e.g. 255.255.255.0) in the input fields; the system auto-detects both formats

3

View Results in Real Time

After input, the system automatically calculates and displays network address, broadcast address, host count and other complete subnet information — no button click needed

4

Copy or Export

Click results to copy directly; VLSM division results are displayed in table format for viewing each subnet's detailed information

Use Cases

Network Planning

Quickly calculate subnet division schemes for enterprise network architecture design, determine usable IP ranges and network boundaries

Server Operations

Verify IP membership and network ranges when configuring firewall rules and routing tables to avoid configuration errors

Coursework & Learning

Auxiliary tool for computer network course labs, helping students understand subnet division, VLSM and CIDR principles

Cloud Network Configuration

Calculate CIDR ranges and usable IP counts when configuring subnets on AWS VPC, Alibaba Cloud VPC and other cloud platforms

Network Troubleshooting

Troubleshoot IP conflicts, network configuration errors and other network issues, quickly locate IP membership and subnet boundaries

Subnetting Fundamentals

What is a Subnet Mask?

A subnet mask is a 32-bit binary number used to distinguish the network portion and host portion of an IP address. Bits set to 1 in the mask correspond to network bits, and bits set to 0 correspond to host bits. For example, 255.255.255.0 means the first 24 bits are network bits and the last 8 bits are host bits.

What is CIDR Notation?

CIDR (Classless Inter-Domain Routing) represents a network using "IP/prefix length", e.g. 192.168.1.0/24 indicates the first 24 bits are network bits. CIDR replaces traditional Class A/B/C classification, enabling more flexible subnetting.

What is VLSM?

VLSM (Variable Length Subnet Mask) allows using different subnet mask lengths within the same network, allocating network segments of different sizes based on each subnet's actual host demand, reducing IP address waste.

What is Route Aggregation?

Route aggregation (supernetting) merges multiple consecutive small networks into a larger network to reduce the number of routing table entries. For example, 192.168.0.0/24 and 192.168.1.0/24 can be aggregated into 192.168.0.0/23.

Subnetting Formulas

Network Address

Network Address = IP Address AND Subnet Mask

Perform bitwise AND between the IP address and the subnet mask to obtain the network address.

Broadcast Address

Broadcast Address = Network Address OR Wildcard Mask

Perform bitwise OR between the network address and the wildcard mask (inverted mask).

Usable Host Count

Usable Hosts = 2^(32-CIDR) - 2

Subtracts two reserved addresses: network address and broadcast address. /31 is special-cased to 2 per RFC 3021.

Wildcard Mask

Wildcard Mask = ~Subnet Mask

Bitwise NOT of the subnet mask, used for ACL configuration and broadcast address calculation.

FAQ

Q1: How to use the subnet mask calculator?
A: On the Basic Subnet Calc tab, enter an IP plus CIDR (e.g. /24) or mask (e.g. 255.255.255.0); the system automatically calculates and displays network address, broadcast address, usable host range and other complete information.
Q2: How to convert between CIDR and subnet mask?
A: The CIDR prefix length equals the number of leading 1 bits in the mask. /24 maps to 255.255.255.0, /16 maps to 255.255.0.0. This tool supports automatic detection of both input formats.
Q3: What is VLSM and how do I calculate it?
A: VLSM lets you assign different subnet sizes per need. The VLSM Division tab supports equal-split mode and custom demand mode; custom mode sorts requirements descendingly and allocates optimally.
Q4: What does route aggregation (supernetting) do?
A: Supernetting merges multiple consecutive small networks into a larger one to shrink routing tables and improve efficiency. This tool finds the smallest covering supernet and flags exact vs. inexact aggregation.
Q5: How is the usable host count calculated and why subtract 2?
A: Usable hosts = 2^(32-CIDR) - 2, subtracting two reserved addresses: the network address (all 0s) and broadcast address (all 1s). /31 networks are special-cased to 2 usable per RFC 3021 for point-to-point links.
Q6: Which IP ranges are private?
A: RFC 1918 defines three private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. This tool automatically detects whether an input IP belongs to a private address range.