🎓 Computer Science • Computer Science Calculators 100% Client-Side Privacy

IPv4 Subnet Calculator (CIDR & Masks)

Calculates IPv4 subnet partitions, network ID, broadcast IP, usable address range, and total host capacity.

IPv4 CIDR Subnet Calculator & Address Allocator

Computes network ID, broadcast IP, usable host range, 32-bit subnet mask, and RFC classifications

Quick Architectural Presets
/24
/0 (Internet 4.3B hosts)Prefix Length: /24/32 (Single Host)

Dynamic Subnet Address Space Allocation

Visual topology of Network ID, Default Gateway, Usable Host Pool, and Broadcast Address

RFC 1918 Private Home/Office (192.168.0.0/16)
NETWORK ID192.168.1.0USABLE HOST RANGE (254 Hosts)192.168.1.1 → 192.168.1.254Gateway: 192.168.1.1BROADCAST IP192.168.1.255First IP (Reserved)Assignable Client IPsLast IP (Broadcast)

32-Bit Binary Mask & Boundary Visualizer

Octet-by-octet breakdown showing Network bits (blue) vs Host bits (emerald)

Net: 24 bitsHost: 8 bits
IP Address: 192.168.1.150Hex: 0xC0A80196
Octet 1
11000000
Octet 2
10101000
Octet 3
00000001
Octet 4
10010110
Subnet Mask: 255.255.255.0Hex: 0xFFFFFF00
Octet 1
11111111
Octet 2
11111111
Octet 3
11111111
Octet 4
00000000
Network Address (ID)
192.168.1.0
First IPv4 address of subnet
Broadcast Address
192.168.1.255
All host bits set to 1
Subnet Mask
255.255.255.0
Hex: 0xFFFFFF00
Wildcard Mask (Cisco ACL)
0.0.0.255
Inverted binary subnet mask
Usable Host Range
192.168.1.1 – 192.168.1.254
Gateway: 192.168.1.1
Usable Host Capacity
254usable
Total addresses: 256 (2^8)

What is IPv4 Subnetting?

Subnetting divides a larger IP network into smaller, more efficient subnetworks. CIDR (Classless Inter-Domain Routing) specifies the number of leading network bits using prefix notation (e.g. /24).

Formula & Step-by-Step Calculation

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

Network address and broadcast address are reserved.

Worked Step-by-Step Examples

Example 1

Subnet 192.168.1.150 with CIDR /24

Solution: Network: 192.168.1.0, Broadcast: 192.168.1.255, Usable: 254 hosts
• 32 - 24 = 8 host bits ⟹ 2⁸ - 2 = 254 usable hosts

Common Real-World & Academic Use Cases

  • ✓ Cloud VPC network architecture (AWS, Azure, GCP)
  • ✓ Enterprise LAN DHCP scope configuration
  • ✓ Firewall security rule access control lists

How to Use the IPv4 Subnet Calculator (CIDR & Masks)

1

Enter IP Address

Input standard IPv4 address.

2

Select CIDR Prefix

Choose /0 through /32.

3

Read Network Parameters

Inspect network ID, broadcast, and usable IP range.

Frequently Asked Questions

Q: Why are 2 addresses subtracted from total hosts?

The first address is reserved as the Network ID, and the last address is reserved as the Broadcast Address.

Related Computer Science Calculators