Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Tech & Development Calculators
  3. /Network & IP Calculators
  4. /CIDR Calculator

CIDR Calculator

Calculator

Results

Total Addresses

256

addresses

Usable Host Addresses

254

hosts

Network Bits

24

bits

Host Bits

8

bits

Subnet Mask Octet 1

255

Subnet Mask Octet 2

255

Subnet Mask Octet 3

255

Subnet Mask Octet 4

256

Wildcard Octet 1

0

Wildcard Octet 2

0

Wildcard Octet 3

0

Wildcard Octet 4

-1

Addresses Per Half

128

addresses

Addresses Per Quarter

64

addresses

Results

Total Addresses

256

addresses

Usable Host Addresses

254

hosts

Network Bits

24

bits

Host Bits

8

bits

Subnet Mask Octet 1

255

Subnet Mask Octet 2

255

Subnet Mask Octet 3

255

Subnet Mask Octet 4

256

Wildcard Octet 1

0

Wildcard Octet 2

0

Wildcard Octet 3

0

Wildcard Octet 4

-1

Addresses Per Half

128

addresses

Addresses Per Quarter

64

addresses

The CIDR Calculator (Classless Inter-Domain Routing) converts a CIDR prefix length into its corresponding subnet mask, wildcard mask, total address count, and usable host count. CIDR was introduced in 1993 through RFC 1519 (later superseded by RFC 4632) to replace the rigid classful addressing system that was rapidly exhausting the IPv4 address space. Before CIDR, organizations were assigned Class A (/8 = 16.7M addresses), Class B (/16 = 65,536 addresses), or Class C (/24 = 256 addresses) blocks — with no middle ground. A company needing 500 addresses had to request a Class B, wasting over 65,000 addresses.

CIDR introduced variable-length prefixes, allowing allocations of any power-of-two size. A /23 provides exactly 512 addresses (510 usable), a /22 gives 1,024, and a /21 yields 2,048 — perfectly matching organizational needs without waste. This revolutionized IP address conservation and is credited with extending the usable life of IPv4 by decades alongside NAT (Network Address Translation, RFC 3022). Today, every ISP, cloud provider, and regional Internet registry (RIR) allocates addresses using CIDR notation.

This calculator focuses on the mathematical relationship between the prefix length and its derived values. Enter any prefix from /0 (the entire IPv4 space — 4,294,967,296 addresses) to /32 (a single host), and instantly see the subnet mask in dotted-decimal notation, the wildcard mask (used in Cisco ACLs and OSPF area definitions), and the address counts. These conversions are needed constantly during network configuration, security policy authoring, and infrastructure-as-code (IaC) template creation in tools like Terraform, CloudFormation, and Pulumi.

The subnet mask is the traditional representation used on network interfaces and DHCP servers. For /24, the mask is 255.255.255.0 — the first 24 bits are set to 1, the remaining 8 to 0. The wildcard mask is the bitwise complement: 0.0.0.255. It tells networking equipment which bits to ignore when matching addresses. Understanding both representations is essential for passing CCNA, CCNP, CompTIA Network+, and cloud certification exams, and for configuring real-world network infrastructure.

Network automation scripts frequently require converting between CIDR and mask formats. Python's ipaddress module, Go's net package, and JavaScript networking libraries all work with prefix lengths internally. This calculator provides a quick reference for verifying programmatic output, debugging routing issues, or planning address space allocation during network design sessions. Whether you are configuring BGP route advertisements, defining VPC subnets in AWS, or setting up firewall zones, the CIDR calculator is your go-to reference tool.

For supernetting (route aggregation), CIDR is equally important. Aggregating four contiguous /24 networks into a single /22 reduces routing table size and improves convergence time. This calculator helps verify the math behind such aggregations, ensuring your summarized route covers exactly the intended address space without accidentally including or excluding networks.

Visual Analysis

How It Works

All computations derive from the single input — the prefix length — using base-2 arithmetic on 32-bit IPv4 addresses:

Total Addresses:

$$N_{total} = 2^{(32 - \text{prefix})}$$

Usable Host Addresses:

$$N_{usable} = 2^{(32 - \text{prefix})} - 2$$

The subtraction of 2 accounts for the reserved network address (first) and broadcast address (last) per RFC 950. For /31 (RFC 3021 point-to-point), both addresses are usable. For /32, only the single host address exists.

Subnet Mask (32-bit integer):

$$M = 2^{32} - 2^{(32 - \text{prefix})}$$

For /24: $$M = 4294967296 - 256 = 4294967040$$

The mask is converted to dotted-decimal by extracting each octet:

$$\text{Octet}_1 = \lfloor M / 2^{24} \rfloor \mod 256$$

$$\text{Octet}_2 = \lfloor M / 2^{16} \rfloor \mod 256$$

$$\text{Octet}_3 = \lfloor M / 2^{8} \rfloor \mod 256$$

$$\text{Octet}_4 = M \mod 256$$

Wildcard Mask:

$$W_i = 255 - M_i$$

Each wildcard octet is 255 minus the corresponding mask octet. Equivalently, the wildcard is the bitwise NOT of the mask, restricted to 8 bits per octet.

Understanding Your Results

The total addresses value shows the mathematical size of the CIDR block. Common values: /32 = 1, /30 = 4, /28 = 16, /24 = 256, /20 = 4,096, /16 = 65,536, /8 = 16,777,216. The usable hosts count is what you can actually assign to devices. The subnet mask is configured on network interfaces — common masks include 255.255.255.0 (/24), 255.255.255.128 (/25), 255.255.255.192 (/26), 255.255.255.224 (/27), 255.255.255.240 (/28), and 255.255.255.252 (/30). The wildcard mask is used in Cisco IOS access control lists (ACLs) and OSPF network statements. For example, access-list 10 permit 10.0.0.0 0.0.0.255 matches all addresses in the 10.0.0.0/24 subnet. When comparing prefix lengths, remember that a larger prefix number means a smaller subnet — /28 is 16 times smaller than /24.

Worked Examples

Standard /24 Subnet

Inputs

prefix length24

Results

total addresses256
usable addresses254
mask octet1255
mask octet2255
mask octet3255
mask octet40
wildcard octet10
wildcard octet20
wildcard octet30
wildcard octet4255

The most common subnet size. A /24 provides 254 usable host addresses with a subnet mask of 255.255.255.0 and wildcard mask 0.0.0.255. Used in most office networks, home routers, and as the default VPC subnet size in many cloud providers.

Point-to-Point /30 Link

Inputs

prefix length30

Results

total addresses4
usable addresses2
mask octet1255
mask octet2255
mask octet3255
mask octet4252
wildcard octet10
wildcard octet20
wildcard octet30
wildcard octet43

A /30 provides exactly 2 usable addresses — perfect for point-to-point WAN links between routers. The subnet mask 255.255.255.252 (wildcard 0.0.0.3) is standard for serial interfaces, GRE tunnels, and inter-router connections. Using /30 instead of /24 conserves 252 addresses per link.

Frequently Asked Questions

CIDR stands for Classless Inter-Domain Routing. It was defined in RFC 1519 (1993) and updated in RFC 4632 (2006). 'Classless' refers to its departure from the rigid Class A/B/C system, allowing any prefix length from /0 to /32 for flexible address allocation.

A /24 provides 256 addresses (254 usable), a /25 provides 128 (126 usable), and a /26 provides 64 (62 usable). Each additional bit in the prefix halves the subnet size. Choose based on device count: /24 for up to 254 hosts, /25 for up to 126, /26 for up to 62.

Wildcard masks offer more flexibility than subnet masks because they don't have to be contiguous. While standard subnetting requires contiguous 1-bits, a wildcard mask can have non-contiguous patterns to match specific address ranges. In practice, most wildcards are simple inverses of subnet masks, but the architecture allows complex matching when needed.

A /0 prefix represents the entire IPv4 address space — 4,294,967,296 addresses. It is used as the default route (0.0.0.0/0) in routing tables, meaning 'match all destinations.' No single organization is allocated a /0; the global routing table distributes the space across thousands of prefixes.

CIDR enables supernetting — combining multiple smaller prefixes into one larger prefix. For example, four contiguous /24 networks (10.0.0.0/24 through 10.0.3.0/24) can be aggregated into 10.0.0.0/22. This reduces routing table entries, decreases BGP update traffic, and speeds up route convergence.

A /27 has a subnet mask of 255.255.255.224. It provides 32 total addresses (30 usable). The last octet value 224 comes from: 256 - 2(32-27) = 256 - 32 = 224. This size is common for small departments, server VLANs, or management networks.

Yes, CIDR notation is used extensively with IPv6. The standard subnet for end-user networks is /64 (264 host addresses). ISPs typically receive /32 or /48 allocations. The notation works identically — prefix length indicates network bits — but IPv6 addresses are 128 bits, so prefix lengths range from /0 to /128.

RFC 3021 defines /31 subnets for point-to-point links. With only 2 addresses and no broadcast, both are usable. This saves one address compared to /30 per link. Modern routers (Cisco IOS, Juniper JunOS, Arista EOS) support /31 on point-to-point interfaces.

Count the number of consecutive 1-bits in the binary representation of the mask. For 255.255.255.192: binary is 11111111.11111111.11111111.11000000 — that is 26 ones, so the CIDR prefix is /26. Alternatively, for the last non-255 octet: prefix_bits_in_octet = 8 - log2(256 - octet_value).

You need at least 200 subnets from a /16, so find the smallest power of 2 ≥ 200: 28 = 256. Add 8 bits to the /16 prefix: /24. This gives 256 subnets, each with 254 usable hosts. If subnets need fewer hosts, use /25 (512 subnets, 126 hosts each) or /26 (1024 subnets, 62 hosts each).

Sources & Methodology

RFC 4632 (CIDR), RFC 1519 (Original CIDR), RFC 950 (Subnet Procedure), RFC 3021 (/31 Point-to-Point), Cisco IOS Configuration Guide, AWS VPC Documentation.
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

IP Subnet Calculator

Network & IP Calculators

Data Transfer Calculator

Network & IP Calculators

Download Upload Time Calculator

Network & IP Calculators

Bandwidth Calculator

Network & IP Calculators