CIDR Subnet Calculator

Calculate IPv4 subnet masks, network addresses, broadcast IPs, usable host ranges, binary masks, and visual subnet partitions.

Subnet Parameters

IPv4 CIDR
8 Host Bits
Common Network Presets
Usable Host IP Range
192.168.1.1192.168.1.254
254 Usable Hosts

Subnet Mask

255.255.255.0

Network ID

192.168.1.0

Broadcast IP

192.168.1.255

Wildcard Mask

0.0.0.255

32-Bit Binary Network & Host Representation

Private (Class C - RFC 1918)
Network Binary:11000000.10101000.00000001.00000000
Netmask Binary:11111111.11111111.11111111.00000000

Quarter Subnet Partitioning (/26)

192.168.1.0/2662 hosts
192.168.1.1 - 192.168.1.62
192.168.1.64/2662 hosts
192.168.1.65 - 192.168.1.126
192.168.1.128/2662 hosts
192.168.1.129 - 192.168.1.190
192.168.1.192/2662 hosts
192.168.1.193 - 192.168.1.254

AWS VPC & Cloud Subnetting Rule

AWS VPCs reserve 5 IP addresses per subnet (.0 network, .1 router, .2 DNS, .3 future, .255 broadcast). For AWS architecture, subtract 5 from total IP count.

IPv4 Subnetting Mathematics & CIDR Bit Allocation

An IPv4 address consists of 32 bits divided into a Network portion and a Host portion. In Classless Inter-Domain Routing (CIDR), the prefix (e.g., /24) denotes the number of consecutive leading bits dedicated to network identification.

1. Usable Host Capacity Equation
Usable Hosts=2(32 − CIDR Prefix)2 (Network & Broadcast IPs)
2. Wildcard Mask & Subnet Inversion
Wildcard Mask=255.255.255.255Subnet Mask
Step-by-Step Calculation Breakdown
Step 1: Partition 32 Bits for /24 Prefix
Network Bits = 24 Bits | Host Bits = 32 − 24 = 8 Bits
Total IP Block Size = 28 = 256 Total Addresses
Step 2: Reserve Network and Broadcast Boundaries
Network Address = 192.168.1.0 (First IP in range)
Broadcast Address = 192.168.1.255 (Last IP in range)
Step 3: Determine Usable Host Range
Usable Range=192.168.1.1 to 192.168.1.254 (254 Usable Hosts)

CIDR Prefix Reference Table (/16 to /30)

CIDRSubnet MaskTotal IPsRFC Usable HostsAWS VPC Usable
/16255.255.0.065,53665,53465,531
/20255.255.240.04,0964,0944,091
/24255.255.255.0256254251
/26255.255.255.192646259
/28255.255.255.240161411
/30255.255.255.252420 (VPC Minimum /28)

Frequently Asked Questions

What is CIDR notation and how does subnetting work?
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its associated routing prefix using a slash followed by the prefix bit length (e.g., 192.168.1.0/24). An IPv4 address contains 32 binary bits. The prefix number (e.g. /24) indicates that the first 24 bits represent the network address, leaving 8 bits for host addresses (yielding 2^8 = 256 total IP addresses, with 254 usable for devices).
Why are 2 IP addresses subtracted from the usable host count in standard IPv4?
In standard IPv4 networking, the very first IP in a subnet is reserved as the Network Identifier (the network itself), and the very last IP is reserved as the Broadcast Address (used to transmit packets to all hosts in the subnet simultaneously). Therefore, the formula for usable hosts is 2^(32 - prefix) - 2.
Why does AWS VPC reserve 5 IP addresses per subnet instead of 2?
In Amazon Web Services (AWS) VPC subnets, AWS reserves 5 IP addresses in every CIDR block: 1. Network address (.0), 2. VPC router (.1), 3. AWS DNS server (.2), 4. Future reserved usage (.3), and 5. Network broadcast (.255). For example, a /24 subnet in AWS provides 251 usable IP addresses rather than the standard 254.
What are the RFC 1918 Private IPv4 address ranges?
RFC 1918 defines three non-routable private IP address spaces for internal local networks: Class A (10.0.0.0/8 providing 16.7M IPs), Class B (172.16.0.0/12 providing 1.04M IPs), and Class C (192.168.0.0/16 providing 65,536 IPs). These addresses cannot be routed across the public internet.
What is a Wildcard Mask and where is it used?
A Wildcard Mask is the exact bitwise inverse of a subnet mask (calculated as 255.255.255.255 minus the Subnet Mask). For example, a /24 subnet mask is 255.255.255.0 and its wildcard mask is 0.0.0.255. Wildcard masks are widely used in Cisco IOS Access Control Lists (ACLs) and OSPF routing configurations.
What is the difference between /24, /28, and /16 subnets?
A /16 subnet provides 65,534 usable hosts (ideal for large enterprise datacenters or VPC parent CIDRs). A /24 subnet provides 254 usable hosts (standard for office LANs and microservice clusters). A /28 subnet provides 14 usable hosts (ideal for small database tiers, jump hosts, or point-to-point router links).

Related Tools