Skip to main content

IPv4 CIDR & Subnet Mask Calculator

Subnetting is fundamental to network engineering, cloud VPC design, and routing architecture.

Routing bit-mask prefix (e.g. 24 for standard /24 C-class subnet, 16 for /16, 30 for point-to-point link).

Calculated Result
254 hosts

Usable Hosts

Subnet Mask

255.255.255.0

Wildcard Mask

0.0.0.255

Total Addresses

256

CIDR Notation

/24

Calculation Breakdown

  1. Host Bit Allocation (32 - CIDR)32 - 24 = 8 host bits
  2. Subnet Capacity (2^hostBits)2^8 = 256 total IPs (Usable: 254 hosts)
  3. Dotted Decimal Mask & WildcardSubnet Mask: 255.255.255.0 | Wildcard: 0.0.0.255

Usable Host Addresses by Common CIDR Subnets

Interactive visualization based on your current inputs

Calculated Value
0.064127191254/24/25/26/27/28

What Is the IPv4 CIDR & Subnet Mask Calculator?

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing IP packets.

It replaced the older class-based network design (Class A, B, C) to slow the exhaustion of IPv4 address space.

How Does the IPv4 CIDR & Subnet Mask Calculator Work?

The calculator computes the 32-bit subnet mask bitmask by setting the first N prefix bits to 1 and remaining host bits to 0.

Total addresses are 2 raised to the power of available host bits.

Usable hosts subtract network identifier (.0) and broadcast address (.255).

IPv4 CIDR & Subnet Mask Calculator Formula & Variables

The core mathematical equation utilized by this calculator is expressed as:

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

Each IPv4 address contains 32 bits. The CIDR prefix determines the network bits, leaving 32 - prefix for host addressing.

How to Use the IPv4 CIDR & Subnet Mask Calculator

  1. Enter your subnet prefix number without the slash (e.g., 24).
  2. Read the dotted-decimal subnet mask (255.255.255.0) and usable host capacity.

Step-by-Step Example Calculation

Standard Class C /24 Subnet

Input Values:

cidrPrefix:24

Understanding Your Result

Subnet mask determines the boundary between network routing and local device addressing.

Wildcard mask is used in Cisco access control lists (ACLs) and OSPF router configurations.

Factors That Affect the Result

  • Point-to-point router links (/31) vs standard broadcast subnets.

When Should You Use This Calculator?

  • Configuring cloud VPCs (AWS, GCP, Azure), enterprise firewalls, and home router DHCP ranges.

Assumptions & Limitations

  • Standard IPv4 32-bit architecture.

Frequently Asked Questions

Calculation Accuracy & Reference Note

Standard IETF RFC 1878 and RFC 3021 compliance.

Explore more tools and calculators in Everyday Life Calculators