Main Suites
โšก 23 Interactive Playgrounds ๐Ÿงฎ 17 Financial Calculators ๐Ÿ› ๏ธ 49 Developer Tools
Knowledge & Guides
๐Ÿ“– Smart Shopping Masterclass ๐Ÿ“š Blog & Articles โ„น๏ธ About & Mission โ“ FAQ
GET IT ON Google Play
Networking & Cloud Utility

IPv4 Subnet & CIDR Calculator

Calculate network addresses, broadcast addresses, usable host IP ranges, wildcard masks, and binary bitmasks in real time.

Presets:
Private Network (RFC 1918) Class C Network 254 Usable Hosts
Calculated Network Details Click row to copy
Network Address (ID): 192.168.1.0
Broadcast Address: 192.168.1.255
Usable Host IP Range: 192.168.1.1 โ€“ 192.168.1.254
Subnet Mask: 255.255.255.0
Wildcard (Inverse) Mask: 0.0.0.255
Total / Usable Hosts: 256 total / 254 usable
32-Bit Binary Bitmask Visualization
IP Binary: 11000000.10101000.00000001.00000001
Mask Binary: 11111111.11111111.11111111.00000000
NetID Binary: 11000000.10101000.00000001.00000000

What is IPv4 Subnetting and Classless Inter-Domain Routing (CIDR)?

An IPv4 address is a 32-bit numeric address expressed as four decimal octets separated by periods (e.g. 192.168.1.1). Subnetting is the architectural practice of subdividing a single large network into smaller, isolated sub-networks (subnets). Subnetting optimizes routing performance, reduces broadcast network congestion, and enforces security boundaries between departments, virtual machines, and cloud environments (such as AWS VPCs, Azure VNets, and Google Cloud subnets).

In 1993, the IETF standardized Classless Inter-Domain Routing (CIDR) under RFC 4632 to replace rigid class-based network allocations (Class A, B, and C). In CIDR notation, a forward slash followed by a prefix number (e.g. /24) defines the exact number of leading bits reserved for the network prefix, leaving the remaining bits for individual host devices.

The Mathematics of Subnet Calculations

Given a 32-bit IPv4 address with a prefix length n:

  • Host Bits: H = 32 - n
  • Total IP Addresses: 2^H = 2^(32 - n)
  • Usable Host Addresses: 2^H - 2 (subtracting the Network ID and the Broadcast Address)

For instance, in a /24 subnet: 32 - 24 = 8 host bits. Total addresses = 2^8 = 256. Usable hosts = 256 - 2 = 254.

Comprehensive CIDR Prefix & Subnet Mask Reference Table

CIDR Prefix Subnet Mask Total Addresses Usable Hosts Typical Cloud / Network Use Case
/8 255.0.0.0 16,777,216 16,777,214 Large enterprise private networks (RFC 1918 10.0.0.0/8).
/16 255.255.0.0 65,536 65,534 Standard AWS / Azure VPC root network block.
/20 255.255.240.0 4,096 4,094 Kubernetes cluster pod network subnet.
/24 255.255.255.0 256 254 Most common local LAN and public cloud web tier subnet.
/28 255.255.255.240 16 14 Small isolated database cluster or DMZ subnet.
/30 255.255.255.252 4 2 Point-to-point router links.
/32 255.255.255.255 1 1 Single specific host route or firewall IP whitelist.

RFC 1918 Private IPv4 Address Allocations

The Internet Assigned Numbers Authority (IANA) designated three blocks of IPv4 address space for private networks that are not routed on the public global Internet:

  • 24-bit block (Class A): 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
  • 20-bit block (Class B): 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
  • 16-bit block (Class C): 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)

Frequently Asked Questions (FAQ)

Why does AWS reserve 5 IP addresses instead of 2 in each subnet?

In AWS VPC subnets, Amazon reserves the first 4 IP addresses and the last IP address (e.g. .0 for network ID, .1 for VPC router, .2 for AWS DNS, .3 for future use, and .255 for broadcast). Therefore, a /24 in AWS yields 251 usable IP addresses rather than 254.

What is a Wildcard Mask used for?

A wildcard mask (the inverse of a subnet mask) is used in Cisco IOS Access Control Lists (ACLs) and routing protocols (OSPF, EIGRP). A 0 bit means "match this bit exactly", while a 1 bit means "ignore this bit (wildcard)".

โœ“ Copied to clipboard