Subnet Calculator

Enter an IPv4 address and CIDR prefix to calculate network details.

Input

Results

CIDR0.0.0.0/0
Subnet Mask0.0.0.0
Network Address0.0.0.0
Broadcast Address255.255.255.255
First Host0.0.0.1
Last Host255.255.255.254
Total Hosts4294967296
Usable Hosts4294967294

Notes:

  • Usable hosts = total hosts - 2 (network & broadcast).
  • /31 and /32 behave differently (usable = 0 in normal cases).
  • This calculator only supports IPv4.

Subnetting: Mastering IPv4 Infrastructure

IP Subnetting is the foundational process of dividing a large network into smaller, efficient sub-networks. Our Professional Subnet Calculator empowers network engineers to optimize address space, reduce broadcast traffic, and harden security by isolating critical network segments.

In the era of CIDR (Classless Inter-Domain Routing), static IP classes (A, B, and C) have evolved into a more flexible system. By manipulating the Subnet Mask, you define the boundary between the network identification and host addresses, ensuring no IP is wasted in your local or cloud environment.

🌐

CIDR Support

Full compatibility with variable prefix lengths from /0 to /32, suitable for everything from backbone routing to host routes.

🖥️

Usable IP Range

Instantly identifies the First and Last Host, automatically excluding the reserved Network and Broadcast IDs.

🛡️

Network Safety

Prevent IP conflicts by visualizing Broadcast Boundaries and total host capacity before deploying hardware.

The Subnetting Math

The binary logic behind address allocation

Host Calculation Logic

Total Addresses = 2^(32 − prefix)
Usable Hosts = 2^(32 − prefix) − 2

Note: Subtracting 2 accounts for the Network ID and the Broadcast Address.

Understanding Masking

The subnet mask is a 32-bit number that masks an IP address and divides it into the network address and host address. It is created by setting network bits to all "1"s and setting host bits to all "0"s.

Bitwise AND Operation

The Network Address is found by performing a Bitwise AND between the IP address and the Subnet Mask.

Broadcast ID

The Broadcast Address is found by performing a Bitwise OR between the Network Address and the inverted Subnet Mask.

Prefix Reference Table

PrefixSubnet MaskUsable IPs
/24255.255.255.0254
/26255.255.255.19262
/28255.255.255.24014
/30255.255.255.2522

Best Practices for Subnetting

Plan for Growth

Always choose a subnet size that allows for at least 25% future growth in devices. For example, if you have 20 hosts, a /27 (30 hosts) is better than a /28 (14 hosts).

VLAN Segmentation

Use subnets to separate different traffic types—Voice, Data, and Management—into different VLANs. This limits the Blast Radius during a network attack or broadcast storm.

Subnetting FAQ

Why can't I use the first and last address?

The very first address (Network ID) identifies the subnet itself to routers, and the last address (Broadcast) is used to communicate with every device on that subnet simultaneously.

What is the /31 subnet used for?

Defined in RFC 3021, /31 subnets are used for point-to-point links between routers. Since there are only two devices, they don't need separate network and broadcast addresses.

How many subnets are in a /24?

It depends on your target prefix. For example, you can split one /24 into two /25s, four /26s, or sixteen /28 subnets.

Does this support IPv6?

This specific tool is designed for IPv4. IPv6 subnetting follows similar CIDR logic but uses a 128-bit hexadecimal structure, typically starting with a /64 per segment.

Scale Your Infrastructure

Efficient address management is the backbone of a reliable network. Use our tool to calculate boundaries with 100% bitwise precision.

TheCalcX Network Suite • Engineered for Precision