IP Subnet Calculator

Common Subnet Sizes

CIDRMaskHosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

IP Address Classes

Class A1.0.0.0 - 126.255.255.255
Class B128.0.0.0 - 191.255.255.255
Class C192.0.0.0 - 223.255.255.255
Class D224.0.0.0 - 239.255.255.255
Class E240.0.0.0 - 255.255.255.255

Private IP Ranges

10.0.0.0/8
Class A private
172.16.0.0/12
Class B private
192.168.0.0/16
Class C private

Understanding IP Subnetting

What is Subnetting?

Subnetting is the practice of dividing a network into smaller, more manageable subnetworks (subnets). This allows for better organization, improved security, and more efficient use of IP addresses. Each subnet has its own range of IP addresses and can operate as an independent network segment.

Key Subnet Components

Network Address: First address in subnet (identifies the network)
Broadcast Address: Last address (reaches all hosts)
Subnet Mask: Defines network vs. host portions
Usable Hosts: Addresses available for devices

CIDR Notation

Classless Inter-Domain Routing (CIDR) notation represents the subnet mask as a suffix indicating the number of network bits. For example, /24 means 24 bits for the network portion, leaving 8 bits for hosts.

CIDRSubnet MaskWildcard MaskTotal IPsUsable Hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/16255.255.0.00.0.255.25565,53665,534
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/32255.255.255.2550.0.0.011

How Subnet Calculation Works

Example: 192.168.1.100/24

IP Address: 192.168.1.100
Binary: 11000000.10101000.00000001.01100100
Subnet Mask: 255.255.255.0 (/24)
Mask Binary: 11111111.11111111.11111111.00000000
Network Address: 192.168.1.0 (IP AND Mask)
Broadcast: 192.168.1.255 (Network OR ~Mask)
First Host: 192.168.1.1
Last Host: 192.168.1.254
Usable Hosts: 254

Binary Math Behind Subnetting

Subnet calculations use bitwise operations. The network address is found by performing a bitwise AND between the IP and subnet mask. The broadcast address is found by OR-ing the network address with the inverted mask (wildcard mask).

Network Address

IP: 11000000.10101000.00000001.01100100
Mask: 11111111.11111111.11111111.00000000
AND: 11000000.10101000.00000001.00000000

Broadcast Address

Net: 11000000.10101000.00000001.00000000
Wild: 00000000.00000000.00000000.11111111
OR: 11000000.10101000.00000001.11111111

Why Usable Hosts = Total - 2?

In each subnet, two addresses are reserved:

Network Address

The first address (all host bits = 0) identifies the network itself. It cannot be assigned to a device.

Broadcast Address

The last address (all host bits = 1) is used to send messages to all hosts on the network simultaneously.

Special Subnets

/30 Subnet: Only 2 usable hosts. Perfect for point-to-point links between routers.
/31 Subnet: 2 addresses, both usable. RFC 3021 allows this for point-to-point links (no broadcast needed).
/32 Subnet: Single host. Used to represent a specific host in routing tables and access control lists.

Practical Applications

1
Network Segmentation: Divide a large network into departments (HR, Engineering, Sales) for better organization and security.
2
IP Conservation: Use smaller subnets to avoid wasting IP addresses. A 10-device office needs a /28, not a /24.
3
Access Control: Firewalls and ACLs use subnets to define which networks can communicate with each other.

IPv4 vs IPv6

This calculator is for IPv4 addresses (32-bit). IPv6 uses 128-bit addresses with different notation and subnetting concepts. IPv6 subnets are typically /64, providing 2^64 addresses per subnet.

Frequently Asked Questions

What does CIDR notation like /24 mean?

CIDR notation indicates how many bits are used for the network portion. /24 means 24 network bits and 8 host bits, giving 256 total addresses (254 usable). /24 equals subnet mask 255.255.255.0.

How many usable hosts are in a subnet?

Total hosts = 2^(host bits) - 2. We subtract 2 for network address and broadcast address. A /24 has 2^8 - 2 = 254 usable hosts. A /30 has 2^2 - 2 = 2 usable hosts (common for point-to-point links).

What is the difference between subnet mask and wildcard mask?

Subnet mask has 1s for network bits (255.255.255.0). Wildcard mask is the inverse with 1s for host bits (0.0.0.255). Wildcard masks are used in access control lists (ACLs) and routing protocols like OSPF.

What are private IP address ranges?

Private IPs are not routable on the internet: 10.0.0.0/8 (Class A), 172.16.0.0/12 (Class B), 192.168.0.0/16 (Class C). Most home networks use 192.168.x.x. These addresses can be reused in different private networks.