🌐 IP Subnet Calculator

Enter an IPv4 address and CIDR prefix to instantly get the network address, broadcast address, subnet mask, wildcard mask, usable host range, and IP address class.

🖧 Subnet Details
Enter a valid IPv4 address, e.g. 192.168.1.0 (each octet 0–255).
Four decimal octets separated by dots, each between 0 and 255.
A smaller number means a larger network; a larger number means a smaller subnet with fewer hosts.
📋 Subnet Breakdown
Network Address (CIDR)
Network Address
Broadcast Address
Subnet Mask
Wildcard Mask
First Usable Host
Last Usable Host
Total Addresses
Usable Hosts
IP Address Class

🔎 Address in Binary

⚠️ This tool performs standard IPv4 CIDR subnetting math. /31 subnets follow RFC 3021 (both addresses usable, point-to-point), and /32 represents a single host route. It does not validate reachability, routing, or whether the address is publicly routable — it is a pure calculation aid.
🌐

Enter an IP address and CIDR prefix to see the subnet breakdown

Guide

About the IP Subnet Calculator

Subnetting is the process of splitting a larger IPv4 network into smaller, self-contained segments — and doing the binary math by hand is tedious and error-prone. This IP subnet calculator takes any IPv4 address and CIDR prefix length (from /8 down to /30) and instantly returns the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total address count, usable host count, and the legacy IP address class, all computed with real bitwise operations on the 32-bit integer representation of the address rather than a lookup table.

How It Works

The calculator first validates that the address you entered is a well-formed IPv4 dotted-decimal address (four octets, each 0–255). It then converts the address into a single 32-bit integer, and converts the CIDR prefix length into a subnet mask by setting the first N bits to 1 and the rest to 0. A bitwise AND between the address and the mask yields the network address; flipping the mask's bits (a bitwise NOT) gives the wildcard mask, and OR-ing that wildcard mask with the network address yields the broadcast address. The first usable host is one address above the network address, and the last usable host is one address below the broadcast address — except for /31 (both addresses usable per RFC 3021) and /32 (a single host).

Why It Matters

Correct subnetting prevents two very common and disruptive networking mistakes: assigning overlapping address ranges to different network segments, and under- or over-sizing a subnet so it either runs out of host addresses too soon or wastes a large block of address space that could serve other segments. Whether you're designing VLANs for an office, carving out address space for a cloud VPC, or just studying for a networking certification, seeing the exact network boundaries, broadcast address, and usable host range for a given prefix removes the guesswork from IP address planning.

Tips for Accurate Results

  • Remember that the network address and broadcast address are never assignable to a device — only the range in between counts as usable hosts (with the /31 and /32 exceptions noted above).
  • When you don't know the exact starting address of a subnet, enter any address within the range — the calculator will correctly determine the network address the same way a router would, using a bitwise AND with the mask.
  • Use a longer prefix (e.g. /28 or /29) for small point-to-point or device-limited segments, and a shorter prefix (e.g. /22 or /16) for larger networks — this avoids wasting address space or running out of hosts.
  • The IP address class shown is informational only; virtually all modern networks are addressed using CIDR rather than the old class-based (A/B/C) rules, so don't size a subnet based on its class.
  • Double-check the CIDR prefix matches what's configured on your router or DHCP server — a mismatched mask is one of the most common causes of "can't reach this device" networking issues.
About

Understanding IPv4 Subnetting

🧮

CIDR Notation

CIDR notation like /24 tells you how many of the 32 bits in an IPv4 address are the fixed "network" portion. The remaining bits are the "host" portion — more host bits means more usable addresses in that subnet, but also a bigger, less segmented network.

📡

Network vs. Broadcast

The network address (all host bits 0) identifies the subnet itself and the broadcast address (all host bits 1) is used to reach every device on it. Neither can be assigned to an individual host — only the addresses strictly between them are usable.

🏷️

IP Address Classes

Before CIDR existed, IPv4 space was divided into classes: A (1–126, default /8), B (128–191, default /16), C (192–223, default /24), D (224–239, multicast), and E (240–255, experimental/reserved). Classes are legacy today but still show up in networking terminology.

FAQ

Frequently Asked Questions

Common questions about IP subnetting

What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation, like 192.168.1.0/24, expresses an IP address followed by a slash and the number of bits used for the network portion of the address. A /24 means the first 24 bits are the network, leaving 8 bits (256 addresses) for hosts.
How is the subnet mask calculated from a CIDR prefix?
The subnet mask is formed by setting the first N bits (the CIDR prefix length) to 1 and the remaining bits to 0, then writing the 32-bit result as four dotted-decimal octets. A /24 prefix produces the mask 255.255.255.0 because the first 24 bits are all 1s.
What is the difference between the network address and the broadcast address?
The network address is the lowest address in a subnet (all host bits set to 0) and identifies the subnet itself — it cannot be assigned to a device. The broadcast address is the highest address (all host bits set to 1) and is used to send a packet to every host on that subnet. Neither is usable as a normal host address.
Why are two addresses subtracted from the total to get usable hosts?
Every subnet reserves its lowest address as the network address and its highest address as the broadcast address, so those two cannot be assigned to hosts. For a /24 (256 total addresses), that leaves 254 usable host addresses. The exceptions are /31, used for point-to-point links where both addresses are usable per RFC 3021, and /32, a single host route.
What do IP address classes A, B, and C mean?
Classes are a legacy (pre-CIDR) way of categorizing IPv4 address ranges by their leading bits: Class A (1–126) originally implied a /8 default mask, Class B (128–191) a /16, and Class C (192–223) a /24. Class D (224–239) is reserved for multicast and Class E (240–255) for experimental use. Modern networks use CIDR instead of class-based rules, but the class is still a useful quick reference.

Related Calculators

Explore other tech tools