CIDR Subnet Calculator: Notation and Network Bit Math Guide

Contents
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
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)
- IP (
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
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
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.129through192.168.1.190are 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.
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.
- Enter your target IP in the IP Address field. (e.g., 192.168.1.1)
- Pick the bit count (e.g., /24) from the Subnet mask (prefix) dropdown.
- 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.
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
/16block gives you 2^16 = 65,536 IPs, enough to build a huge internal virtual environment. - When you split that into subnets, using
/24blocks 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