Back to Blog
    Share Article:

    Demystifying CIDR Notation: The Complete Guide to IP Subnetting and Routing Prefixes

    August 23, 2026
    IP Address Pro Team
    5 min read
    CIDR
    Subnetting
    Networking
    IPv4

    Whether you are configuring cloud infrastructure on platforms like Amazon Web Services or Google Cloud, establishing firewall rules, or studying network engineering fundamentals, you will inevitably encounter CIDR notation. Expressed as an IP address followed by a forward slash and a trailing number—such as 192.168.1.0/24—CIDR notation is the universal standard for defining IP address ranges and network subnet boundaries across modern computer networks.

    Despite its ubiquity across digital infrastructure, CIDR notation often confuses newcomers who struggle to understand what the trailing prefix length means and how it dictates host capacity. This guide breaks down the mechanics of Classless Inter-Domain Routing, explains how bit boundaries dictate network scaling, and provides intuitive formulas for calculating host ranges.

    The Historical Shift: Moving From Classful Networks to CIDR

    To understand why CIDR notation exists today, it helps to examine how IP addresses were allocated in the early days of the internet.

    Originally, IPv4 addresses were divided into rigid structural categories called Classful Networks:

    • Class A Networks: Designed for giant enterprise entities, assigning 8 bits to the network identifier and leaving 24 bits for host endpoints, yielding over 16 million IP addresses per allocation.
    • Class B Networks: Designed for mid-sized institutions, splitting the address equally with 16 network bits and 16 host bits, yielding 65,536 addresses per allocation.
    • Class C Networks: Designed for small local networks, assigning 24 bits to the network identifier and leaving 8 bits for host endpoints, yielding 256 total addresses per allocation.

    This rigid structure resulted in massive inefficiencies. An enterprise organization that required 500 IP addresses was too large for a single Class C block of 256 addresses, forcing internet authorities to assign them a massive Class B block of 65,536 addresses. As a result, tens of thousands of IP addresses sat completely unused within assigned blocks, accelerating the rapid exhaustion of the 32-bit IPv4 pool.

    To solve this problem, Classless Inter-Domain Routing was introduced in 1993 under RFC 1518 and RFC 1519. CIDR eliminated rigid class boundaries entirely, introducing Variable Length Subnet Masking (VLSM). This breakthrough allowed network architects to carve out address blocks scaled precisely to an organization's actual operational footprint.

    How CIDR Notation Works: Understanding the Prefix Length

    CIDR notation follows a simple, concise formatting syntax: IP_Address/Prefix_Length.

    The first portion of the expression represents the base starting IP address of the target network block. The slash acts as a separator character, followed by an integer known as the prefix length.

    The prefix length represents the exact number of leading binary bits reserved for the Network ID. Because an IPv4 address is composed of exactly 32 total bits divided across 4 octets, whatever bits remain after subtracting the prefix length are allocated to individual Host Identifiers.

    For example, in the common subnet prefix 192.168.1.0/24, the number 24 indicates that the first 24 bits of the 32-bit address are locked permanently to define the network location. The remaining 8 bits (32 total bits minus 24 network bits) are available for assigning unique address variations to connected client hosts.

    Calculating Total Address Space and Usable Host Capacities

    Calculating the size of any CIDR block requires applying two basic mathematical formulas based on binary exponents.

    Calculating Total Available IP Addresses

    To determine the total number of IP addresses contained within a given CIDR block, raise 2 to the power of the remaining host bits:

    Total Addresses = 2(32 - Prefix Length)

    For a /24 network prefix, the calculation is 2(32 - 24), which equals 28, yielding exactly 256 total IP addresses.

    For a larger /16 cloud network prefix, the calculation is 2(32 - 16), which equals 216, yielding 65,536 total IP addresses.

    Calculating Usable Host Endpoints

    In standard computer networking, you cannot assign every single IP address within a block to individual client devices. In any standard subnet, two addresses are automatically reserved by protocol standards:

    • The Network Address: The absolute first IP address in the range is reserved to identify the overall network subnet itself.
    • The Broadcast Address: The absolute final IP address in the range is reserved to broadcast data packets simultaneously to all active devices within that subnet.

    Therefore, the formula for calculating total usable host addresses is:

    Usable Hosts = 2(32 - Prefix Length) - 2

    For a /24 prefix block, subtracting 2 reserved addresses from 256 total addresses leaves exactly 254 usable host addresses available for assignment to computers, servers, printers, and routers.

    Frequently Asked Questions

    What is the difference between a /24 and a /16 CIDR prefix?

    A /24 prefix reserves 24 network bits, leaving 8 host bits for up to 254 usable devices. A /16 prefix reserves 16 network bits, leaving 16 host bits for up to 65,534 usable devices. Smaller prefix numbers represent larger overall networks.

    What does a /32 CIDR prefix represent?

    A /32 prefix indicates that all 32 bits are allocated to the network ID, leaving zero host bits. This represents a single specific host IP address, commonly used in strict firewall rules.

    Why do cloud platforms like AWS reserve additional addresses in subnets?

    Major cloud providers reserve the first four IP addresses and the final IP address in every subnet for internal infrastructure tasks like gateway routing, DNS service resolution, and network mapping.

    Try Our Tools

    Put what you've learned into practice with our comprehensive suite of network and security tools.

    Related Articles