IP Subnet Calculator
1. Network Address = IP Address & Subnet Mask
2. Broadcast Address = Network Address | (NOT Subnet Mask)
3. First Host = Network Address + 1
4. Last Host = Broadcast Address - 1
5. Total Hosts = 2^(32 - CIDR)
6. Usable Hosts = Total Hosts - 2
1. Network Address = IPv6 Address with host bits set to 0
2. First Address = Network Address + 1
3. Last Address = All host bits set to 1
4. Total Addresses = 2^(128 - prefix length)
5. /64 is standard for most networks
IP Subnet Calculator: Understand Subnetting Easily
A subnet, short for subnetwork, refers to a segmented portion of an IP network. IP networks operate on a set of communication rules known as the Internet Protocol Suite, widely recognized as TCP/IP (Transmission Control Protocol/Internet Protocol). This protocol is the foundation of how devices communicate across the Internet and private networks.
What is Subnetting?
Subnetting is the process of dividing a large network into smaller, manageable subnetworks. This division improves routing efficiency and network security. Devices called routers connect these subnets, directing data traffic between them while serving as boundaries for each subnetwork.
IPv4 vs. IPv6
Most networks today use IPv4 addressing, although adoption of IPv6—introduced to handle the growing number of connected devices—has been steadily increasing since 2006.
Each IP address consists of two main parts:
Network Prefix: Identifies the network segment.
Host Identifier: Specifies the unique device within that segment.
These components are defined using a format called CIDR (Classless Inter-Domain Routing). CIDR allows flexible allocation of IP addresses for both IPv4 and IPv6, replacing the older class-based system (Class A, B, and C).
Understanding Subnet Masks and CIDR Notation
In IPv4, a subnet mask separates the network part from the host part of an IP address. This mask is often shown in dot-decimal format, like 255.255.255.0
. The same structure is represented more concisely using CIDR notation, such as /24
, where the number indicates how many bits belong to the network portion.
In IPv6, the prefix length plays a similar role, indicating the size of the network portion in bits. Every device within the same subnet shares the same prefix, but each has a unique host ID.
The Shift from Class-Based to CIDR
Before CIDR, IP addresses were categorized into fixed classes:
Class A: Large networks
Class B: Medium-sized networks
Class C: Smaller networks
This rigid classification limited flexibility. CIDR was introduced to allow more efficient and scalable IP address allocation. Today, every IP address assignment includes a subnet mask (or prefix length) to define the network boundary.
IPv4 Subnet Table: Prefix Sizes, Masks, and Host Capacity
Here’s a handy reference table showing common IPv4 subnet sizes, their corresponding subnet masks, and the number of usable hosts available per subnet:
CIDR Prefix | Subnet Mask | Usable Hosts |
---|---|---|
/1 | 128.0.0.0 | 2,147,483,646 |
/2 | 192.0.0.0 | 1,073,741,822 |
/3 | 224.0.0.0 | 536,870,910 |
/4 | 240.0.0.0 | 268,435,454 |
/5 | 248.0.0.0 | 134,217,726 |
/6 | 252.0.0.0 | 67,108,862 |
/7 | 254.0.0.0 | 33,554,430 |
Class A | ||
/8 | 255.0.0.0 | 16,777,214 |
/9 | 255.128.0.0 | 8,388,606 |
/10 | 255.192.0.0 | 4,194,302 |
/11 | 255.224.0.0 | 2,097,150 |
/12 | 255.240.0.0 | 1,048,574 |
/13 | 255.248.0.0 | 524,286 |
/14 | 255.252.0.0 | 262,142 |
/15 | 255.254.0.0 | 131,070 |
Class B | ||
/16 | 255.255.0.0 | 65,534 |
/17 | 255.255.128.0 | 32,766 |
/18 | 255.255.192.0 | 16,382 |
/19 | 255.255.224.0 | 8,190 |
/20 | 255.255.240.0 | 4,094 |
/21 | 255.255.248.0 | 2,046 |
/22 | 255.255.252.0 | 1,022 |
/23 | 255.255.254.0 | 510 |
Class C | ||
/24 | 255.255.255.0 | 254 |
/25 | 255.255.255.128 | 126 |
/26 | 255.255.255.192 | 62 |
/27 | 255.255.255.224 | 30 |
/28 | 255.255.255.240 | 14 |
/29 | 255.255.255.248 | 6 |
/30 | 255.255.255.252 | 2 |
/31 | 255.255.255.254 | 0 |
/32 | 255.255.255.255 | 0 |