---
title: "CIDR Notation Explained: Ranges, Blocks, and Prefixes"
slug: "/guides/cidr-notation-explained"
description: "CIDR notation writes an IP block as an address and a prefix length. See what /24 means, how to find a block's size and range, and how IPv6 prefixes work."
---

# CIDR Notation Explained: Ranges, Blocks, and Prefixes

By [Sheharyar Malik](https://www.linkedin.com/in/sheharyar-malik-haniel/) Senior Software Engineer

Posted on November 20, 2026 | 21 min read

![CIDR Notation Explained: Ranges, Blocks, and Prefixes](https://blogs.ipgeolocation.io/blogs-site/content/images/size/w1600/format/webp/2026/11/cidr-notation-explained-feature-nested-blocks.png)

CIDR notation describes a block of IP addresses with an address and a prefix length, such as 192.168.1.0/24. The prefix length says how many bits at the start of the address stay fixed; the rest can vary. Here, 24 bits are fixed, and 8 vary, so the block holds 256 addresses, from 192.168.1.0 to 192.168.1.255.

CIDR stands for Classless Inter-Domain Routing, and IPv6 uses the same notation over 128 bits. You'll meet it in firewall rules, cloud subnets, WHOIS records, and BGP routes. It's also how IP data describes the networks around an address, and one address can belong to several blocks at once, each answering a different question.

* * *

## TL;DR

CIDR notation fixes the first n bits of an address, so a prefix of length n holds 2^(32 − n) IPv4 addresses or 2^(128 − n) IPv6 addresses. For example, a /24 holds 256 and a /16 holds 65,536. The larger the number after the slash, the smaller the block.

*   In an ordinary IPv4 subnet with a prefix length of 30 or less, the first and last addresses are the network and broadcast addresses, so a /24 has 254 usable hosts. A /31 on a point-to-point link uses both of its addresses, and a /32 is one host.
*   Every block starts on a multiple of its own size, which is why 192.168.1.64/25 isn't a valid block.
*   Two blocks either don't overlap or one sits inside the other, and routers forward traffic by the longest prefix that matches.
*   In IPv6, a /64 is one LAN subnet, and a /48 holds 65,536 of them.

* * *

## Prefix, block, and range: three names for one set

A CIDR block is the set of IP addresses that share the same first bits. [RFC 4632](https://www.rfc-editor.org/rfc/rfc4632.html), the standard that defines CIDR, describes classless "blocks of IP addresses (referred to as prefixes)", so the names overlap by design:

*   **Prefix:** the shared first bits, written as the block's first address with the prefix length: 192.168.1.0/24. Without the /24, 192.168.1.0 is just an address. An interface address such as 192.168.1.130/26 uses the same notation for one host plus the size of its network.
*   **Prefix length:** the number after the slash, from 0 to 32 in IPv4 and 0 to 128 in IPv6. RFC 4632 calls it "the number of significant bits".
*   **CIDR block:** every address that begins with those bits. ARIN's own record for 165.227.0.0/16, for example, stores it as a `netBlock` with a `cidrLength` of 16.
*   **CIDR range:** the same block written as its first and last address, so 192.168.1.0/24 is the range 192.168.1.0 to 192.168.1.255.

Every CIDR block is a range, but not every range is a CIDR block. A range is one block only when it holds a power of two addresses and starts on a multiple of that number. The range 10.0.0.5 to 10.0.0.25 holds 21 addresses, so writing it in CIDR takes five blocks. That's why registry records and IP databases often store a start and an end address instead, and why a single WHOIS range can turn into several firewall rules.

A [subnet mask](https://ipgeolocation.io/guides/what-is-a-subnet-mask) carries the same information in another form: a /24 is 24 one-bits followed by 8 zero-bits, which written as four numbers is 255.255.255.0. The IPv4 CIDR chart lists the mask for every length.

* * *

## How to read any IPv4 CIDR block

To read a block, subtract the prefix length from 32, raise 2 to the result for the block size, and round the address down to the block's start. Take 192.168.1.130/26, an address from a server's network interface:

1.  **Count the free bits.** 32 − 26 = 6. These six are the host bits; the other 26 are the prefix.
2.  **Size the block.** 2^6 = 64 addresses.
3.  **Find the number where the cut falls.** An IPv4 address is four 8-bit numbers, called octets. Twenty-six bits is three full octets plus 2 bits, so 192.168.1 is fixed and the cut lands inside the fourth number.
4.  **Round that number down to a multiple of its step.** The step is 2 raised to the free bits inside that octet; here 2^6 = 64, so blocks in the fourth octet start at 0, 64, 128, and 192. 130 sits in the one that starts at 128, so the first address is 192.168.1.128.
5.  **Add the size minus 1.** 128 + 63 = 191, so the last address is 192.168.1.191.

![A magnifying glass over a 0 to 255 ruler for the fourth number of 192.168.1.130/26: the /26 block from .128 to .191 holds 130, 64 addresses, so the network block is 192.168.1.128/26](https://blogs.ipgeolocation.io/blogs-site/content/images/2026/11/cidr-notation-explained-magnifier-fourth-number.webp)

So 192.168.1.130/26 lives in the block 192.168.1.128/26: 64 addresses, from 192.168.1.128 to 192.168.1.191. In an ordinary subnet, the first and last of those are the network and broadcast addresses, which leaves 62 for hosts.

The form you started from matters. 192.168.1.130/26 is an interface address: one host, plus the size of the network it belongs to. Written as a block, that network is 192.168.1.128/26, and many tools reject the first form where they expect a block. Python's `ipaddress` module raises a "has host bits set" error, which is what catches a mistyped allowlist entry.

The steps don't change when the cut falls earlier. In 172.16.0.0/12, 20 bits are free, so the block holds 2^20 = 1,048,576 addresses. The cut lands in the second number, which has 4 fixed bits and 4 free bits, so its step is 2^4 = 16. Since 16 is a block start, the second number runs from 16 to 31. Every octet after the cut runs from 0 to 255, so the block spans 172.16.0.0 to 172.31.255.255, one of the three private ranges.

IPGeolocation.io's [IPv4 CIDR calculator](https://ipgeolocation.io/tools/cidr-to-ipv4) runs these steps for any block, and [how IP addresses work](https://ipgeolocation.io/guides/what-is-an-ip-address-and-how-does-it-work) is a refresher on the four-number format itself.

* * *

## IPv4 CIDR chart: /0 to /32

Every IPv4 prefix length, with its subnet mask, the number of addresses it holds, and the hosts you can assign in an ordinary subnet:

| Prefix | Subnet Mask | Addresses | Usable Hosts (One Ordinary Subnet) | Where You'll See It |
| --- | --- | --- | --- | --- |
| /0  | 0.0.0.0 | 4,294,967,296 | n/a | Every IPv4 address; the default route |
| /1  | 128.0.0.0 | 2,147,483,648 | 2,147,483,646 |     |
| /2  | 192.0.0.0 | 1,073,741,824 | 1,073,741,822 |     |
| /3  | 224.0.0.0 | 536,870,912 | 536,870,910 |     |
| /4  | 240.0.0.0 | 268,435,456 | 268,435,454 |     |
| /5  | 248.0.0.0 | 134,217,728 | 134,217,726 |     |
| /6  | 252.0.0.0 | 67,108,864 | 67,108,862 |     |
| /7  | 254.0.0.0 | 33,554,432 | 33,554,430 |     |
| /8  | 255.0.0.0 | 16,777,216 | 16,777,214 | Legacy Class A size; 10.0.0.0/8 is private use |
| /9  | 255.128.0.0 | 8,388,608 | 8,388,606 |     |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 | 100.64.0.0/10, the shared address space |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 |     |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | 172.16.0.0/12 is private use |
| /13 | 255.248.0.0 | 524,288 | 524,286 |     |
| /14 | 255.252.0.0 | 262,144 | 262,142 |     |
| /15 | 255.254.0.0 | 131,072 | 131,070 |     |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Legacy Class B size; 192.168.0.0/16 is private use |
| /17 | 255.255.128.0 | 32,768 | 32,766 |     |
| /18 | 255.255.192.0 | 16,384 | 16,382 |     |
| /19 | 255.255.224.0 | 8,192 | 8,190 |     |
| /20 | 255.255.240.0 | 4,096 | 4,094 |     |
| /21 | 255.255.248.0 | 2,048 | 2,046 |     |
| /22 | 255.255.252.0 | 1,024 | 1,022 |     |
| /23 | 255.255.254.0 | 512 | 510 |     |
| /24 | 255.255.255.0 | 256 | 254 | Legacy Class C size; the longest prefix generally routed on the internet (as of 2015); ARIN's minimum end-user assignment |
| /25 | 255.255.255.128 | 128 | 126 |     |
| /26 | 255.255.255.192 | 64  | 62  |     |
| /27 | 255.255.255.224 | 32  | 30  |     |
| /28 | 255.255.255.240 | 16  | 14  |     |
| /29 | 255.255.255.248 | 8   | 6   |     |
| /30 | 255.255.255.252 | 4   | 2   |     |
| /31 | 255.255.255.254 | 2   | 2   | Point-to-point link; both addresses are hosts |
| /32 | 255.255.255.255 | 1   | 1   | One host (a host route) |

The usable count is the block size minus 2, because an ordinary subnet reserves its first address as the network address and its last as the [broadcast address](https://ipgeolocation.io/guides/unicast-anycast-multicast-and-broadcast-explained). Two lengths break that rule: [RFC 3021](https://www.rfc-editor.org/rfc/rfc3021.html) lets both addresses of a /31 serve as hosts on a point-to-point link, and a /32 names exactly one address. Cloud platforms can reserve more: [AWS keeps five addresses](https://docs.aws.amazon.com/vpc/latest/userguide/subnet-sizing.html) in every VPC subnet, so a /24 subnet there leaves 251 for your resources. For the largest blocks the count is only arithmetic: a /8 is never run as one subnet, and real allocations leave out reserved and special-purpose ranges.

The legacy class sizes, the default route, and the host route come from the table in [RFC 4632](https://www.rfc-editor.org/rfc/rfc4632.html). The /24 note comes from [RFC 7454](https://www.rfc-editor.org/rfc/rfc7454.html), which recorded in 2015 that IPv4 prefixes longer than /24 were "generally neither announced nor accepted in the Internet". ARIN's /24 minimum for end-user organizations is in section 4.3.2 of its [Number Resource Policy Manual](https://www.arin.net/participate/policy/nrpm/).

* * *

## Why every CIDR block starts on a boundary

A CIDR block's first address has all of its free bits set to zero, so a block of 2^k addresses always starts on a multiple of 2^k. That rule decides which blocks exist. A /24 such as 192.168.1.0/24 holds exactly two /25s: 192.168.1.0/25, from .0 to .127, and 192.168.1.128/25, from .128 to .255. There's no third one at 192.168.1.64/25: 64 isn't a multiple of 128, so no /25 starts there, and the /25 that contains 192.168.1.64 is 192.168.1.0/25.

The same rule gives CIDR its most useful property: two CIDR blocks either don't overlap at all or one sits entirely inside the other. They never half-overlap the way two arbitrary ranges can.

That property makes overlap checks short: two blocks overlap only when the larger one, the block with the smaller prefix number, contains the other's first address. It also explains why joined networks clash. If one office uses 10.0.0.0/16 and another 10.0.128.0/17, the /17 sits inside the /16, so the same addresses exist on both sides until one renumbers or uses address translation.

Aggregation, combining neighboring blocks into one shorter prefix, follows the same rule. 192.168.0.0/24 and 192.168.1.0/24 combine into 192.168.0.0/23, because the pair starts on a /23 boundary. 192.168.1.0/24 and 192.168.2.0/24 are just as adjacent, yet no /23 holds both: one /23 ends at 192.168.1.255 and the next starts at 192.168.2.0. A firewall needs two entries for that pair. Older texts call aggregation supernetting, and router configuration calls it route summarization.

![Four railway cars for 192.168.0.0/24 to 192.168.3.0/24: cars .0 and .1 couple into 192.168.0.0/23 and cars .2 and .3 into 192.168.2.0/23, but cars .1 and .2 cannot couple, so 192.168.1.0 to 192.168.2.255 needs two CIDR blocks](https://blogs.ipgeolocation.io/blogs-site/content/images/2026/11/cidr-notation-explained-railway-cars-merge.webp)

* * *

## One IP address, several CIDR blocks

One address belongs to several CIDR blocks at once, and each block answers a different question. On October 27, 2026, an IPGeolocation.io lookup of 165.227.0.0, the sample address in our documentation, returned two:

*   **The route, `network.route`: 165.227.0.0/20.** DigitalOcean's network, [AS14061](https://ipgeolocation.io/browse/asn/AS14061), announces this block over BGP: 4,096 addresses, from 165.227.0.0 to 165.227.15.255.
*   **The abuse-handling range, `abuse.route`: 165.227.0.0/16.** ARIN registers this space to DigitalOcean, LLC as a direct allocation, record [NET-165-227-0-0-1](https://whois.arin.net/rest/net/NET-165-227-0-0-1): 65,536 addresses, with DigitalOcean's abuse team as the contact.

![165.227.0.0 sits on a raised tile, the announced route 165.227.0.0/20 (AS14061, network.route), one of 16 tiles of DigitalOcean's ARIN allocation 165.227.0.0/16 (abuse.route in this example)](https://blogs.ipgeolocation.io/blogs-site/content/images/2026/11/cidr-notation-explained-route-tile-in-allocation.webp)

Both are right: the /16 is the space DigitalOcean holds, and the /20 is one of the pieces it announces. The ASN API's route list for AS14061 showed the whole cut that day: fifteen /20s plus four /22s that together make up the last /20, 165.227.240.0/20. Our [range page for 165.227.0.0/16](https://ipgeolocation.io/browse/ipv4/165.227.0.0/16) counts the same 19 prefixes, and the free [lookup page for 165.227.0.0](https://ipgeolocation.io/browse/ip/165.227.0.0) shows the route and the abuse range side by side.

That's why our team cautions against reading route counts as address counts: 19 route records cover these 65,536 addresses, and nothing requires routes to be /24s or to match one another. [Regional internet registries](https://ipgeolocation.io/guides/what-is-a-regional-internet-registry) allocate large blocks, and each holder's network, identified by its [autonomous system number](https://ipgeolocation.io/guides/what-is-an-asn), decides how to cut that space into announced routes. As a result, [a registry record and a BGP route can differ](https://ipgeolocation.io/blog/how-ip-geolocation-data-is-built).

The blocks don't always differ: for 8.8.8.8, Google Public DNS, the route and the abuse range are both 8.8.8.0/24, which our [range page for 8.8.8.0/24](https://ipgeolocation.io/browse/ipv4/8.8.8.0/24) places inside 8.8.0.0/16 and 8.0.0.0/8.

A block isn't a place, either, and reading one as a place is one of the two mistakes our team sees most often. Our range page shows the same 165.227.0.0/16 spread across 4 countries, because a route or a registration defines a range of addresses, not a geographic boundary. Look up the address you care about, not the block around it.

* * *

### 1. Which block to act on when one address misbehaves

Each block is the right answer to one question:

*   **Who holds the space:** the registered range, here the /16 in ARIN's records. It's useful for finding the registered organization.
*   **Which network carries the traffic:** the route, `network.route`, and the autonomous system behind it.
*   **Where to send an abuse report:** the abuse contact for the most specific registration or reassignment that covers the address. An IPGeolocation.io lookup returns that contact with the range it covers in `abuse.route`, which can be far smaller than an allocation; the example in our documentation is a /29.
*   **What to block:** the addresses your evidence covers. We wouldn't block the /20 or the /16 automatically because one address in it was abusive, and the /16 isn't proof that every address in the allocation took part.

An abuse report should carry the exact offending IPs, the timestamps, and the evidence.

* * *

### 2. How routers pick the most specific block

When several routes contain the same destination, a router forwards by the longest prefix, so the most specific block wins. [RFC 4632](https://www.rfc-editor.org/rfc/rfc4632.html) says forwarding in the internet "is done on a longest-match basis". [RFC 1812](https://www.rfc-editor.org/rfc/rfc1812.html) works through an example: routes for 10.0.0.0/8, 10.144.0.0/16, and 10.144.2.0/24 all contain the destination 10.144.2.5, and the router keeps 10.144.2.0/24, the longest prefix.

![A router with three cables for 10.0.0.0/8, 10.144.0.0/16 and 10.144.2.0/24, each ending on its ring of a target; 10.144.2.5 lands inside all three rings and the packet takes the 10.144.2.0/24 cable, the longest prefix](https://blogs.ipgeolocation.io/blogs-site/content/images/2026/11/cidr-notation-explained-longest-prefix-target.webp)

Longest match is what lets nested blocks coexist. A /16 can be announced as one route while a /20 inside it is announced separately, and traffic for the /20's addresses follows the more specific route.

* * *

## How to check whether an IP is in a CIDR block

An address is inside a block when its first n bits match the block's prefix, and that comparison has to run on numbers, not on text. Consider an SSH access-control script that compares a visitor's IP address against an allowlist using plain string matching. A visitor at 192.0.2.45 should match the 192.0.2.0/24 range, but a literal string comparison returns false. The bug fits in three lines:

```python
allowlist = ["192.0.2.0/24"]
visitor_ip = "192.0.2.45"
print(visitor_ip in allowlist)  # False: compares text, not address ranges
```

Python's standard `ipaddress` module parses both sides and tests membership on the bits. This version parses the allowlist once at startup, handles IPv4 and IPv6, matches IPv4 clients that a dual-stack server logs in their IPv6-mapped form, and refuses entries written with host bits set (both code blocks need Python 3.9 or later):

```python
from ipaddress import ip_address, ip_network


def load_allowlist(entries: list[str]) -> list:
    """Parse allowlist entries once, at startup, so a bad entry fails immediately."""
    networks = []
    for entry in entries:
        try:
            # strict=True rejects an entry written with host bits set, such as
            # 192.0.2.45/24, instead of silently widening it to 192.0.2.0/24.
            networks.append(ip_network(entry.strip(), strict=True))
        except ValueError as err:
            raise ValueError(f"bad allowlist entry {entry!r}: {err}") from err
    return networks


def is_allowed(ip: str, networks: list) -> bool:
    """Return True if the IP address falls inside any allowlisted block."""
    try:
        address = ip_address(ip.strip())
    except ValueError:
        return False  # not an IP address at all, so never allowed
    # Dual-stack servers can log an IPv4 client as ::ffff:192.0.2.45;
    # compare its IPv4 form so it matches IPv4 entries.
    if address.version == 6 and address.ipv4_mapped:
        address = address.ipv4_mapped
    # `in` is False when versions differ, so one list can hold IPv4 and IPv6 blocks.
    return any(address in network for network in networks)


# Raises ValueError at startup if an entry is malformed.
allowlist = load_allowlist(["192.0.2.0/24", "2001:db8:1::/48"])

for visitor in ["192.0.2.45", "::ffff:192.0.2.45", "198.51.100.7", "2001:db8:1:2::10", "not-an-ip"]:
    print(f"{visitor}: {'allowed' if is_allowed(visitor, allowlist) else 'not allowed'}")
```

Running it prints:

```
192.0.2.45: allowed
::ffff:192.0.2.45: allowed
198.51.100.7: not allowed
2001:db8:1:2::10: allowed
not-an-ip: not allowed
```

Because `load_allowlist` runs once and raises on a bad entry, a typo such as 192.0.2.45/24 stops the script at startup with "has host bits set", rather than surfacing later as a visitor who can't get in. Write IPv4 ranges in IPv4 form: the function converts a mapped client address to IPv4 before matching, so an entry written as ::ffff:192.0.2.0/120 matches nothing. To compare two blocks rather than an address and a block, `ip_network(a).overlaps(ip_network(b))` says whether they share any address, and `subnet_of()` says whether one sits inside the other. The same membership test guards [trusting only your proxies' CIDR ranges](https://ipgeolocation.io/guides/get-real-client-ip-address) when a server reads the client address from X-Forwarded-For.

* * *

### 1. Converting a start and end address to CIDR blocks

Registry records and IP databases often give a range as two addresses, while firewalls and cloud security rules want CIDR. `summarize_address_range` returns the smallest set of blocks that covers a range exactly:

```python
from ipaddress import ip_address, summarize_address_range


def range_to_cidrs(first: str, last: str) -> list[str]:
    """Return the smallest list of CIDR blocks that covers first..last exactly."""
    try:
        start, end = ip_address(first.strip()), ip_address(last.strip())
        return [str(block) for block in summarize_address_range(start, end)]
    except (ValueError, TypeError) as err:
        # ValueError: a malformed address, or last comes before first.
        # TypeError: one IPv4 and one IPv6 address.
        raise ValueError(f"can't convert {first} to {last}: {err}") from err


try:
    print(range_to_cidrs("10.0.0.5", "10.0.0.25"))
    print(range_to_cidrs("192.168.1.0", "192.168.2.255"))
except ValueError as err:
    print(err)
```

Output:

```
['10.0.0.5/32', '10.0.0.6/31', '10.0.0.8/29', '10.0.0.16/29', '10.0.0.24/31']
['192.168.1.0/24', '192.168.2.0/24']
```

The first is the 21-address range; no single block fits, so it breaks into five. The second is the misaligned pair of /24s, which stays two blocks. For a one-off conversion without code, IPGeolocation.io's [IP range to CIDR converter](https://ipgeolocation.io/tools/ip-range-to-cidr) does the same job for IPv4 and IPv6.

* * *

## CIDR notation in IPv6

IPv6 uses the same notation over 128 bits: a prefix of length n holds 2^(128 − n) addresses, written as address/prefix-length in the form [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291.html) defines. Reading one by hand takes two facts. Each hex digit is 4 bits, so each of the eight colon-separated groups is 16 bits, and "::" stands for as many all-zero groups as the address needs to reach eight.

Take 2001:db8:1:100::/56. The first three groups, 2001, db8, and 1, are 48 bits, and the next 8 bits are the first two hex digits of the fourth group, 0100 in full. So the block fixes 2001:db8:1 plus that "01", runs from 2001:db8:1:100:: to 2001:db8:1:1ff:ffff:ffff:ffff:ffff, and holds 256 /64 subnets, one for each value of the fourth group's last two digits. IPGeolocation.io's [IPv6 CIDR calculator](https://ipgeolocation.io/tools/cidr-to-ipv6) does the same expansion for any block.

Two IPv4 habits don't carry over. IPv6 has no broadcast address, a function RFC 4291 says is "superseded by multicast addresses", so the IPv4 "subtract two" rule doesn't apply. The formula gives the total number of addresses in a block; reserved uses and the network's configuration decide which of them go to ordinary hosts. The address whose last 64 bits are all zero, for example, is the Subnet-Router anycast address, which [RFC 6164](https://www.rfc-editor.org/rfc/rfc6164.html) says shouldn't be assigned as a unicast address.

A /64 also isn't sized by how many devices it serves. Most unicast addresses use their last 64 bits as the interface ID ([RFC 7136](https://www.rfc-editor.org/rfc/rfc7136.html) keeps that length at 64 bits), so a LAN subnet is a /64 however few hosts sit on it.

The sizes you'll meet most:

| Prefix | Example | Holds | Where You'll See It |
| --- | --- | --- | --- |
| /32 | 2001:db8::/32 | 65,536 /48s | ARIN's minimum ISP allocation, unless the ISP asks for a /36 or /40 |
| /48 | 2001:db8:1::/48 | 65,536 /64s | ARIN's initial assignment to an end-user organization |
| /56 | 2001:db8:1:100::/56 | 256 /64s | RFC 6177's example of a smaller default for home users |
| /64 | 2001:db8:1:101::/64 | 18,446,744,073,709,551,616 addresses | One LAN subnet |
| /127 | 2001:db8:1:101::2/127 | 2 addresses | A point-to-point link between two routers (RFC 6164) |
| /128 | 2001:db8:1:101::1/128 | 1 address | A single address |

The ARIN sizes come from sections 6.5.2.1 and 6.5.8.2 of its [Number Resource Policy Manual](https://www.arin.net/participate/policy/nrpm/). [RFC 6177](https://www.rfc-editor.org/rfc/rfc6177.html) explains why end sites have no single size. A /48 "is no longer recommended as a single default", and a site should get at least one /64, "and in most cases significantly more". Routing has a practical floor here too: [RFC 7454](https://www.rfc-editor.org/rfc/rfc7454.html) recorded in 2015 that IPv6 prefixes longer than /48 were generally neither announced nor accepted.

Every example here sits in 2001:db8::/32, one of the two documentation prefixes in [IANA's IPv6 special-purpose registry](https://www.iana.org/assignments/iana-ipv6-special-registry); the other is 3fff::/20.

![Six cards for /32 (ISP allocation), /48 (organization), /56 (home), /64 (one LAN), /127 (router link) and /128 (one address), each with a 128-bit bar showing its fixed bits and an example in 2001:db8::/32](https://blogs.ipgeolocation.io/blogs-site/content/images/2026/11/cidr-notation-explained-ipv6-prefix-size-cards.webp)

* * *

## Special CIDR blocks you'll see in logs and configs

A short list of reserved blocks turns up in nearly every log, allowlist, and code sample. [IANA's IPv4 special-purpose registry](https://www.iana.org/assignments/iana-ipv4-special-registry) records what each one is for:

| Block | What It's For | Defined In |
| --- | --- | --- |
| 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | Private use, for internal networks | RFC 1918 |
| 100.64.0.0/10 | Shared address space | RFC 6598 |
| 127.0.0.0/8 | Loopback | RFC 1122 |
| 169.254.0.0/16 | Link local | RFC 3927 |
| 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Documentation (TEST-NET-1, TEST-NET-2, and TEST-NET-3) | RFC 5737 |
| 198.18.0.0/15 | Benchmarking | RFC 2544 |
| 0.0.0.0/8 | "This network" | RFC 791 |
| 240.0.0.0/4 | Reserved | RFC 1112 |
| 255.255.255.255/32 | Limited broadcast | RFC 8190 and RFC 919 |

IANA marks none of these blocks as globally reachable under their designated uses. A private address such as 192.168.1.10 can identify a device inside one network, but the address alone doesn't identify a unique device or location across the public internet. IPGeolocation.io's guide to [bogon addresses](https://ipgeolocation.io/guides/what-are-bogon-ip-addresses) covers how to filter these blocks. 0.0.0.0/0 is different: it isn't a reserved block but the whole IPv4 space, used as the default route, and as a firewall source, it matches any IPv4 address.

* * *

## What is CIDR, and why did it replace IP classes?

CIDR, Classless Inter-Domain Routing, is how IP addresses are allocated and routed: in blocks of any power-of-two size, each written with a prefix length, instead of the fixed sizes of the old class system.

Before CIDR, a network was Class A (a /8, 16,777,216 addresses), Class B (a /16, 65,536), or Class C (a /24, 256). An organization that needed 2,000 addresses could take a Class B and leave about 63,500 idle, or take eight Class Cs and add eight entries to every router's table. [RFC 4632](https://www.rfc-editor.org/rfc/rfc4632.html) names the two problems that followed: Class B space was running out, and routing tables were outgrowing what routers' software, hardware, and operators could manage.

CIDR, first published as [RFC 1519](https://www.rfc-editor.org/rfc/rfc1519.html) in September 1993, dropped the fixed sizes and let one route stand for a whole aggregated block. RFC 4632 replaced that document in 2006. It describes the class system as deprecated and keeps "Class A", "Class B", and "Class C" only as legacy labels for /8, /16, and /24. It also says CIDR "did not and does not attempt to solve" the long-term exhaustion of IPv4. IPGeolocation.io's guide to [the Class A, B, and C system](https://ipgeolocation.io/guides/what-is-an-ip-address-and-how-does-it-work) covers the classes in more detail.

* * *

## Common CIDR mistakes

*   **Reading a bigger prefix number as a bigger block.** It's the reverse, and it's one of the two mistakes our team sees most often. Every step up the slash halves the block, so a /16 holds 65,536 addresses and a /24 holds 256.
*   **Reading /24 as 24 addresses.** The number counts fixed bits; the block holds 2^(32 − 24) = 256 addresses.
*   **Asking for an exact size.** Blocks only come in powers of two, so 200 hosts need a /24, with 254 usable addresses, or several smaller blocks.
*   **Assuming every IPv6 network is a /64.** A /64 is one subnet; sites are assigned larger blocks, such as a /48 or a /56, that hold many /64s.
*   **Reading the written address as the wildcard.** 10.0.0.0/16 isn't "10 followed by anything": the /16 fixes the first two numbers, so the block is 10.0.0.0 to 10.0.255.255. The block where everything after the 10 varies is 10.0.0.0/8.

* * *

## CIDR blocks in IPGeolocation.io data

IPGeolocation.io returns routes and abuse-handling ranges in CIDR notation, so the blocks in this guide are the ones you'll read in our responses. The [IP Geolocation API](https://ipgeolocation.io/ip-location-api.html) carries them alongside the rest of an address's data: geolocation, security risk signals, ASN, company, abuse contact, time zone, and, for a user-agent string, user agent data. The security signals include VPN, proxy, Tor, bot, and known-attacker detection, with a 0 to 100 threat score.

Two of its fields are CIDR blocks. `network.route` is the network prefix in CIDR notation that contains the IP, and `abuse.route` is the abuse-handling range in CIDR notation (the block an abuse contact covers, not necessarily a routed prefix), returned when the request includes `include=abuse`. This request asks for only those two:

```bash
# Network and abuse contact data need a paid plan. This request costs
# 2 credits: 1 for the lookup and 1 for the abuse module.
# The key is read from the environment so it never sits in the script.
curl -sS --fail "https://api.ipgeolocation.io/v3/ipgeo?apiKey=${IPGEO_API_KEY}&ip=165.227.0.0&include=abuse&fields=network.route,abuse.route" \
  || echo "Lookup failed: check the API key and that your plan includes network and abuse data" >&2
```

Response (trimmed):

```json
{
  "ip": "165.227.0.0",
  "network": {
    "route": "165.227.0.0/20"
  },
  "abuse": {
    "route": "165.227.0.0/16"
  }
}
```

The route and the abuse range are the two blocks from the 165.227.0.0 example, and the [response field reference](https://ipgeolocation.io/documentation/ip-location-api.html) documents both. From an AS number or an IP, the [ASN API](https://ipgeolocation.io/asn-api.html)'s [`routes` option](https://ipgeolocation.io/documentation/asn-api.html) lists the IPv4 and IPv6 prefixes an ASN manages, with counts of the distinct prefixes it announces. For offline work, the [IP to ASN database](https://ipgeolocation.io/ip-asn-database.html) lists ranges by start and end address and, in its Extended edition, carries the announced routes in CIDR. We update the ASN dataset daily.

Without an API key, our [range pages](https://ipgeolocation.io/browse/ipv4) show the /8, /16, and /24 around an address with each range's announced BGP prefixes and child ranges. Three free CIDR tools convert blocks and ranges in both directions. The [pricing page](https://ipgeolocation.io/pricing.html) shows which fields each plan returns.

## Frequently Asked Questions

### What does 192.168.1.0/24 mean?

**Answer:** 192.168.1.0/24 means every IP address that starts with 192.168.1, from 192.168.1.0 to 192.168.1.255. The first 24 bits are fixed, and only the last number varies; in subnet-mask form, that's 255.255.255.0.

### How many IP addresses are in a /24?

**Answer:** An IPv4 /24 contains 256 addresses, and 254 of them are usable hosts in an ordinary subnet, because the first is the network address and the last is the broadcast address. Its mask is 255.255.255.0; the guide to [the /24 subnet mask](https://ipgeolocation.io/guides/24-subnet-mask) covers what that mask does on a device.

### How many IP addresses are in a /20?

**Answer:** An IPv4 /20 contains 4,096 addresses, 4,094 of them usable as hosts in an ordinary subnet, because 12 bits are free. 165.227.0.0/20, for example, runs from 165.227.0.0 to 165.227.15.255.

### Is CIDR the same as a subnet mask?

**Answer:** For the split between network and host bits, yes: /24 and 255.255.255.0 say the same thing, because the prefix length counts the mask's one-bits. CIDR notation also names the block itself, as in 192.168.1.0/24, and IPv6 uses prefix lengths only.

### What is the CIDR notation for a single IP address?

**Answer:** A single IPv4 address is a /32, such as 203.0.113.10/32, and a single IPv6 address is a /128. Every bit is fixed, so the block holds exactly one address.

### What does 0.0.0.0/0 mean?

**Answer:** 0.0.0.0/0 means every IPv4 address, all 4,294,967,296 of them, because no bits are fixed. Routers use it as the default route, and in a firewall rule it matches any IPv4 source. Whether that traffic is allowed depends on the rule's action and its other conditions.

### How do I find my IP address in CIDR notation?

**Answer:** Your device's address in CIDR notation is its IP address plus its local network's prefix length, such as 192.168.1.34/24; on Linux, `ip -brief address` shows it. Your public address sits in different blocks, which IPGeolocation.io's free lookup pages show as its route and abuse-handling range.

### Does IPv6 use CIDR notation?

**Answer:** Yes, IPv6 uses the same address/prefix-length notation over 128 bits, as RFC 4291 defines it. A /64 is one LAN subnet, a /48 holds 65,536 of them, and a /128 is a single address. IPv6 has no broadcast address, so the IPv4 rule of subtracting two doesn't apply.

### Is CIDR still used?

**Answer:** Yes, CIDR is how IPv4 and IPv6 addresses are allocated and routed, and every route a network announces is a CIDR prefix. RFC 4632, published in 2006 as Best Current Practice 122, is the specification in force.

### What does CIDR stand for?

**Answer:** CIDR stands for Classless Inter-Domain Routing. It replaced the fixed Class A, B, and C network sizes with blocks of any power-of-two size, first in RFC 1519 in September 1993.

* * *

## What to do next

Take a block from your own config or logs, read it with the five steps, and check it in the [IPv4 CIDR calculator](https://ipgeolocation.io/tools/cidr-to-ipv4). To see the blocks around a real address, open a [free lookup page](https://ipgeolocation.io/browse/ip/165.227.0.0). For routes and abuse ranges in code, the [IP Geolocation API](https://ipgeolocation.io/ip-location-api.html) returns `network.route` and `abuse.route` with the rest of an address's data. The free Developer plan gives you 1,000 credits a day for life, with no credit card. Paid plans add more data, such as accuracy radius, company, network, and security data. Both route fields need a paid plan, and the [pricing page](https://ipgeolocation.io/pricing.html) compares plans.

### Related Guides

[![Residential Proxy Networks: How Real Devices Get Hijacked](https://blogs.ipgeolocation.io/blogs-site/content/images/size/w1000/format/webp/2026/11/00-how-residential-proxies-hijack-real-devices-feature.png)](https://ipgeolocation.io/guides/how-residential-proxies-hijack-real-devices)

[Residential Proxy Networks: How Real Devices Get Hijacked](https://ipgeolocation.io/guides/how-residential-proxies-hijack-real-devices)

Residential proxy networks get their IP addresses from real phones, computers, and TV boxes. Here are the five ways devices are recruited, what the owner risks, and how to check your own.

Posted on November 23, 2026

By [Maaz ur Rehman](https://www.linkedin.com/in/muhammad-maaz-995494214/)

[Read More: Residential Proxy Networks: How Real Devices Get Hijacked](https://ipgeolocation.io/guides/how-residential-proxies-hijack-real-devices)

[![What Is a /24 Subnet Mask? 255.255.255.0 Explained](https://blogs.ipgeolocation.io/blogs-site/content/images/size/w1000/format/webp/2026/11/24-subnet-mask-feature.png)](https://ipgeolocation.io/guides/24-subnet-mask)

[What Is a /24 Subnet Mask? 255.255.255.0 Explained](https://ipgeolocation.io/guides/24-subnet-mask)

A /24 subnet mask is 255.255.255.0: 24 network bits, 256 addresses, and 254 usable on a typical LAN. See what the mask tells your device, how to find yours, and why the /24 matters on the internet too.

Posted on November 22, 2026

By [Sheharyar Malik](https://www.linkedin.com/in/sheharyar-malik-haniel/)

[Read More: What Is a /24 Subnet Mask? 255.255.255.0 Explained](https://ipgeolocation.io/guides/24-subnet-mask)

[![IP Intelligence for Payment Fraud Prevention](https://blogs.ipgeolocation.io/blogs-site/content/images/size/w1000/format/webp/2026/11/ip-intelligence-payment-fraud-prevention-feature.png)](https://ipgeolocation.io/guides/ip-intelligence-payment-fraud-prevention)

[IP Intelligence for Payment Fraud Prevention](https://ipgeolocation.io/guides/ip-intelligence-payment-fraud-prevention)

What an IP address can and can't tell you at checkout, during a card-testing attack, in a Visa or Mastercard dispute, and at a promo redemption, with four illustrative IPGeolocation.io lookups and the card-network rules that name the IP address.

Posted on November 21, 2026

By [Sheharyar Malik](https://www.linkedin.com/in/sheharyar-malik-haniel/)

[Read More: IP Intelligence for Payment Fraud Prevention](https://ipgeolocation.io/guides/ip-intelligence-payment-fraud-prevention)

[![How Website Visitor Identification Works With IP-to-Company Data](https://blogs.ipgeolocation.io/blogs-site/content/images/size/w1000/format/webp/2026/11/visual-0-feature-option-a-one-visit-five-networks.webp)](https://ipgeolocation.io/guides/website-visitor-identification)

[How Website Visitor Identification Works With IP-to-Company Data](https://ipgeolocation.io/guides/website-visitor-identification)

Website visitor identification can name a visitor's company only when the visit comes from that company's own network. Here's how one IP lookup tells those visits apart from ISP, cloud, VPN, and gateway traffic, and how to build it on your server.

Posted on November 19, 2026

By [Abdullah Afzal](https://www.linkedin.com/in/abdullah-a-08ba162b7?utm_source=share&utm_campaign=share_via&utm_content=profile&utm_medium=android_app)

[Read More: How Website Visitor Identification Works With IP-to-Company Data](https://ipgeolocation.io/guides/website-visitor-identification)

[![IP Geolocation vs GPS and Browser Location: Which to Use?](https://blogs.ipgeolocation.io/blogs-site/content/images/size/w1000/format/webp/2026/11/feature-image.png)](https://ipgeolocation.io/guides/ip-geolocation-vs-gps-browser-location)

[IP Geolocation vs GPS and Browser Location: Which to Use?](https://ipgeolocation.io/guides/ip-geolocation-vs-gps-browser-location)

IP geolocation tells you where a visitor's network connects from, on every request and without asking. GPS and the browser's Geolocation API tell you where the device is, after the person agrees; here is when to use each and how to combine them.

Posted on November 11, 2026

By [Anwar Ahmed](https://www.linkedin.com/in/anwar-ce/)

[Read More: IP Geolocation vs GPS and Browser Location: Which to Use?](https://ipgeolocation.io/guides/ip-geolocation-vs-gps-browser-location)

[![Types of Proxies: Residential, ISP, Datacenter, and Mobile](https://blogs.ipgeolocation.io/blogs-site/content/images/size/w1000/format/webp/2026/10/0-types-of-proxies-feature.png)](https://ipgeolocation.io/guides/types-of-proxies)

[Types of Proxies: Residential, ISP, Datacenter, and Mobile](https://ipgeolocation.io/guides/types-of-proxies)

The four types of proxies differ in where their IP address comes from: a hosting network, an ISP's address space run from servers, a home connection, or a mobile carrier. Here is how each is built, what an IP lookup shows for it, and how to treat its traffic.

Posted on November 11, 2026

By Abdul Mateen

[Read More: Types of Proxies: Residential, ISP, Datacenter, and Mobile](https://ipgeolocation.io/guides/types-of-proxies)
