CIDR Subnet Calculator: Notation and Network Bit Math Guide

PublishedToolCIDR Subnet Calculator

CIDR Subnet Calculator screen
Contents
  1. The Limits of Classful Addressing and How CIDR Saved the Day
  2. How Subnets Work, Using Binary Math
  3. How to Use the CIDR Subnet Calculator
  4. Wrapping Up
  5. Frequently Asked Questions

The Limits of Classful Addressing and How CIDR Saved the Day

The early internet standard (classful addressing) simply handed an entire Class A block (about 16 million IP addresses) to a country or a large corporation, and gave small groups a Class C block (256 addresses).

As a result, organizations that received a Class A block used only a few thousand of their tens of millions of IPs and wasted the rest — a disaster that significantly sped up the worldwide IPv4 exhaustion crisis. The standard introduced in 1993 to fix this is classless CIDR notation.

  • Format: [Base IP Address]/[Subnet Mask Bits (Prefix)]
  • Example: 192.168.1.100/26
    • The 26 after the slash means that, out of the IP address's 32 bits, the first 26 bits are locked in as a name tag for identifying the network, and the remaining 6 bits (32 - 26) are split up as license plates for assigning host (computer, server) IPs.

How Subnets Work, Using Binary Math

When any CIDR block is assigned, here's the arithmetic a router runs to physically find the network boundary.

Example block: 192.168.1.130/26

  1. Convert the IP and mask to binary:

    • IP (192.168.1.130):
      11000000.10101000.00000001.10000010
    • Subnet mask (/26 — first 26 bits set to 1, last 6 bits set to 0):
      11111111.11111111.11111111.11000000 (decimal: 255.255.255.192)
  2. Network address (bitwise AND):

    • AND the IP and the mask bit by bit, and every host bit gets masked to 0, which gives you the starting boundary.
    • Result: 11000000.10101000.00000001.10000000 → 192.168.1.128
  3. Broadcast address (all host bits set to 1):

    • Fill all 6 bits after the fixed network bits with 1s.
    • Result: 11000000.10101000.00000001.10111111 → 192.168.1.191
  4. Number of usable hosts:

    • Formula: 2^(32 - Prefix) - 2
    • Calculation: 2^(32 - 26) - 2 = 2^6 - 2 = 64 - 2 = 62 (IP range: 192.168.1.129 through 192.168.1.190 are assignable)

How to Use the CIDR Subnet Calculator

If you'd rather not write out binary AND operations on paper and convert network boundaries back to decimal by hand, try a dedicated subnet calculator.

CIDR Subnet Calculator

Enter an IP address and subnet mask (prefix) to instantly calculate the network address, broadcast address, and usable host range.

Using the tool is very mechanical and convenient.

  1. Enter your target IP in the IP Address field. (e.g., 192.168.1.1)
  2. Pick the bit count (e.g., /24) from the Subnet mask (prefix) dropdown.
  3. The moment you type, the results dashboard lays out the network address, the subnet mask in decimal form, the broadcast address, and the actual number of usable IPs along with both endpoints of the IP assignment range in a table.

Wrapping Up

CIDR and subnetting are core protocols for isolating infrastructure resources and optimizing traffic bandwidth. When you're setting cloud firewall (security group) policies or designing redundant switch configurations, hand the headache-inducing math to a subnet calculator and focus entirely on defending the architectural stability of your network topology.

CIDR Subnet Calculator

Enter an IP address and subnet mask (prefix) to instantly calculate the network address, broadcast address, and usable host range.

Frequently Asked Questions

Is there a specific reason people like /16 and /24 blocks when designing an AWS VPC?

It's a balance between mathematical scalability and human readability.

  • A /16 block gives you 2^16 = 65,536 IPs, enough to build a huge internal virtual environment.
  • When you split that into subnets, using /24 blocks means the boundaries fall cleanly every 256 addresses along the third octet of the decimal IP (10.0.1.0/24, 10.0.2.0/24, etc.), which makes it very intuitive to read by eye and debug routing policy tables. That's why it's a best practice in the infrastructure world.

Why do we usually subtract 2 when calculating usable hosts? Does the same apply to /31 and /32?

Because, by convention in network protocols (standards such as RFC 950), two IP addresses in a normal subnet (/0 to /30) are reserved for special purposes.

  • The first address (all host bits set to 0): This is the 'network address' that represents the entire subnet segment, so it can't be assigned to a computer.
  • The last address (all host bits set to 1): This is forcibly reserved as the 'broadcast address', used for multicast-style transmission of a signal to every host in the block at once.
  • So a normal subnet is restricted to assigning only the usable IPs in the middle to hosts, which is why we deduct two.
  • /31 and /32 are the exceptions. /32 is calculated as allowing just one host (itself), and /31 is calculated as allowing both IPs to be used, with no separate network and broadcast address.

This article was written with reference to the IETF RFC 4632 specification. In practice, how things run may vary depending on the routing policy filter rules applied when designing private IP ranges (RFC 1918).

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. cm to inches Conversion: Why You Multiply by 2.54See why 1 inch equals 2.54 cm, how one value converts through meters in two steps, and why feet, yards, and miles get mixed up.
  2. Coin Flip Probability: Law of Large Numbers & Independent TrialsSee why a coin still lands 50/50 after a streak, how the law of large numbers works, and how to spot gambler's fallacy and hot hand bias.
  3. Compound Interest Calculator: Formula and the Rule of 72See how compound interest beats simple interest, learn the formula and the Rule of 72, and project growth from principal, rate, term, and deposits.
  4. Monthly Savings Interest After 15.4% Tax: Compound FormulaSee how monthly savings interest is really calculated, why 15.4% tax withholding shrinks it, and how to project your after-tax maturity value.
  5. P/E, P/B, and EV/EBITDA Formulas: How to Value a StockLearn how P/E, P/B, and EV/EBITDA work, the formulas behind them, and how to avoid valuation traps by industry. Use our free calculator to check results.
  6. System of Equations Solver: Check x and y with Cramer's RuleSee how Cramer's rule turns coefficients a, b, c into determinants D, Dx, and Dy for 2×2 and 3×3 systems, and what D=0 means for the answer.

Related tools