Skip to content
Get Started

How Many IPs Are in a /24 Subnet? (256 Addresses, Explained)

Team CleanProxies
19 Min Read

A /24 subnet holds 256 IPv4 addresses. On a normal office or home network, 254 of them are usable for devices, because the first address (.0) names the network and the last (.255) is the broadcast address. The subnet mask is 255.255.255.0. Cloud networks reserve more (AWS and Azure leave 251 assignable), and proxy providers set their own count per block: our ISP subnet proxies deliver 255 dedicated IPs per /24, sold as one, two or four whole blocks (255, 510 or 1,020 IPs) from $1.19/IP.

Below: the math, every "usable" count and where it comes from, a cheat sheet from /16 to /32, why the /24 is the unit the internet routes on, and a tested Python script that groups your own proxy list by /24 and looks up each block's ASN.

TL;DR

  • Total addresses in a /24: 2^(32 − 24) = 2^8 = 256 (for example 203.0.113.0 to 203.0.113.255).

  • Usable hosts on a LAN: 254 (.1 to .254). .0 is the network address, .255 is broadcast.

  • Usable in an AWS VPC or Azure VNet /24: 251. Both reserve the first four addresses and the last one.

  • Proxy IPs in a rented /24: set by the provider. CleanProxies delivers 255 per block.

  • Mask: 255.255.255.0. Wildcard (inverse) mask: 0.0.0.255.

  • Why proxy users care: the /24 is the smallest block normally routed on the internet, and it's a common unit for grouping IPs. Counting your proxies per /24 shows how concentrated your pool is.

A /24 at a glance

QuestionAnswer
Addresses in a /24256
Usable hosts on a LAN254
Assignable in an AWS / Azure /24 subnet251
Proxy IPs per /24 at CleanProxies255 (dedicated, never shared)
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Network bits / host bits24 / 8
Example range203.0.113.0 – 203.0.113.255
First / last usable host (LAN)203.0.113.1 / 203.0.113.254
/24s in a /224 (1,024 addresses)
/24s in the whole IPv4 space16,777,216
Old classful name"Class C"-sized network

Why a /24 has 256 addresses

An IPv4 address is 32 bits, written as four numbers (octets) from 0 to 255. The number after the slash in CIDR notation says how many of those bits are fixed for the network. In a /24, the first 24 bits (the first three octets) never change. The remaining 8 bits belong to hosts, and 8 bits can hold 2^8 = 256 different values.

203.0.113.77/24

11001011.00000000.01110001 . 01001101
|<----- 24 network bits ---->| |<-8 host bits->|
mask: 11111111.11111111.11111111.00000000 = 255.255.255.0

The general formula is:

  • Total addresses = 2^(32 − prefix)

  • Usable LAN hosts = 2^(32 − prefix) − 2 (for conventional subnets of /30 and larger blocks)

So a /24 is 2^8 = 256 addresses and 254 hosts, a /23 is 512 and 510, a /25 is 128 and 126.

256, 254, 253, 251 or 255: which number is "right"?

Each one is right in its own context. This is the part most calculators skip:

ContextUsable countWhy
Size of the block256Every value of the last octet, .0 to .255
Hosts on an Ethernet/Wi-Fi LAN254.0 identifies the network, .255 is the directed broadcast address, so neither is given to a device
Clients behind a router on that LAN253The router itself takes one of the 254 (often .1)
AWS VPC subnet251AWS reserves .0 (network), .1 (VPC router), .2 (DNS), .3 (future use) and .255 (AWS docs)
Azure virtual network subnet251Azure reserves .0, .1 (gateway), .2 and .3 (Azure DNS) and .255 (Microsoft docs)
Proxy IPs in a rented /24set by the providerIt depends on how the provider configures the block. CleanProxies delivers 255 proxy IPs per /24

When a provider says "a /24", ask how many IPs you actually receive and whether they all come from the same block. That is the number that sets your price per IP.

CIDR cheat sheet: /16 to /32

We generated this table with the script further down (python3 subnet_audit.py table), so every value comes from Python's standard ipaddress module rather than hand math:

CIDRMaskAddressesLAN hostsNumber of /24s
/16255.255.0.065,53665,534256
/17255.255.128.032,76832,766128
/18255.255.192.016,38416,38264
/19255.255.224.08,1928,19032
/20255.255.240.04,0964,09416
/21255.255.248.02,0482,0468
/22255.255.252.01,0241,0224
/23255.255.254.05125102
/24255.255.255.02562541
/25255.255.255.1281281261/2
/26255.255.255.19264621/4
/27255.255.255.22432301/8
/28255.255.255.24016141/16
/29255.255.255.248861/32
/30255.255.255.252421/64
/31255.255.255.25422*1/128
/32255.255.255.255111/256

* A /31 has no network or broadcast address when it is used on a point-to-point link, so both addresses are usable (RFC 3021). A /32 is a single host.

Two shortcuts worth memorising: each step to a shorter prefix doubles the block (/24 → /23 → /22 = 256 → 512 → 1,024), and a /22 is exactly four /24s. Note that four /24s you buy don't have to be one contiguous /22; they can be four separate blocks.

How to calculate a /24 yourself

Python (standard library, no installs)

import ipaddress

net = ipaddress.ip_network("203.0.113.0/24")
print(net.num_addresses)                     # 256
print(net.netmask, net.hostmask)             # 255.255.255.0 0.0.0.255
print(net.network_address, net.broadcast_address)  # 203.0.113.0 203.0.113.255
hosts = list(net.hosts())
print(len(hosts), hosts[0], hosts[-1])       # 254 203.0.113.1 203.0.113.254

# Is an IP inside the block?
print(ipaddress.ip_address("203.0.113.77") in net)   # True
print(ipaddress.ip_address("203.0.114.1") in net)    # False

# Split the /24 into four /26s
print([str(s) for s in net.subnets(new_prefix=26)])
# ['203.0.113.0/26', '203.0.113.64/26', '203.0.113.128/26', '203.0.113.192/26']

# Which /24 does an IP belong to?
print(ipaddress.ip_network("203.0.113.77/24", strict=False))  # 203.0.113.0/24

We ran every line above on Python 3.8.10; the comments show the real output. The hosts() method follows LAN rules and skips .0 and .255, which is why it returns 254.

Spreadsheet

For the number of addresses in any prefix, =2^(32-24) returns 256. Replace 24 with any prefix length. Subtract 2 for LAN hosts on conventional subnets (/30 and larger blocks), or 5 for an AWS or Azure subnet.

Quick mental check

Look at the first three octets. If they match (198.51.100.12 and 198.51.100.240), the two IPs are in the same /24. If the third octet differs (198.51.100.12 and 198.51.101.12), they are in different /24s, even though they may be in the same /23.

Why the /24 is the unit that matters on the internet

Inside your own network you can carve a /24 into /26s or /28s however you like. On the public internet, the /24 is effectively the floor for routing:

  • Routing policy. RFC 7454 (BGP operations and security) records that "IPv4 prefixes longer than /24 … are generally neither announced nor accepted in the Internet". A /25 announced on its own usually doesn't reach most of the internet. A /24 does.

  • The /24 dominates new routes. The CIDR Report dated 31 October 2026 shows 1,088,532 IPv4 prefixes in the routing table it observes. In its "adds per prefix length" for the week, 7,780 of 9,406 added prefixes (83%) were /24s.

  • A natural unit for grouping IPs. Websites see individual source IPs, and each one applies its own rules. Because the /24 is the smallest routed block, it's a common way to group neighbouring addresses, and some systems apply rate limits or blocks to a range rather than a single IP. That is the "bad neighbours" risk in shared proxy pools.

For proxy users, this leads to a simple habit: count your proxies per /24, not just in total. One hundred IPs spread over twenty blocks are less exposed to a single range-level decision than one hundred IPs packed into one block.

Tutorial: audit your proxy list by /24 (tested script)

This script reads the IPv4 addresses in a proxy list (ip:port, ip:port:user:pass or user:pass@ip:port, one per line) and reports:

  • duplicates, and the line numbers it couldn't parse (it never prints the line itself, because it may hold credentials),

  • how many distinct /24 and /16 blocks your IPs are in,

  • how many of your IPs sit in each /24,

  • the origin ASN, BGP prefix and network name for each block, sampled from one IP per /24 via Team Cymru's IP-to-ASN service (all origins are listed if there is more than one),

  • the largest share of your list that sits in a single /24.

It uses only the Python standard library and never connects through your proxies or sends credentials anywhere: the only network call sends one IP per /24 to whois.cymru.com. Use --no-asn to keep it fully offline. It audits the addresses written in the file; if your provider gives you a gateway hostname (as rotating proxies do), the exit IPs websites see are different and aren't in the file.

#!/usr/bin/env python3
"""Group the IPv4 addresses in a proxy list by /24, count IPs per block and look up each block's ASN.

Usage:
  python3 subnet_audit.py table              # print the CIDR cheat sheet
  python3 subnet_audit.py proxies.txt        # audit a list, one proxy per line:
                                             # ip:port, ip:port:user:pass or user:pass@ip:port
  python3 subnet_audit.py proxies.txt --no-asn

It reads the literal IPv4 addresses in the file. Hostnames (rotating gateways),
IPv6 and ports are not checked, and a gateway address is not the exit IP a website sees.
"""
import ipaddress
import socket
import sys
from collections import defaultdict


def cidr_table(first=16, last=32):
    print(f"{'CIDR':<5} {'Mask':<16} {'Addresses':>9} {'LAN hosts':>9} {'/24s':>6}")
    for p in range(first, last + 1):
        net = ipaddress.ip_network(f"0.0.0.0/{p}")
        total = net.num_addresses
        if p == 32:
            hosts = 1          # single host route
        elif p == 31:
            hosts = 2          # RFC 3021 point-to-point link
        else:
            hosts = total - 2  # minus network and broadcast address
        blocks = total / 256
        blocks = f"{int(blocks):,}" if blocks >= 1 else f"1/{int(256 / total)}"
        print(f"/{p:<4} {str(net.netmask):<16} {total:>9,} {hosts:>9,} {blocks:>6}")


def parse_host(line):
    """Return the proxy's IPv4 address from one line, or raise ValueError.

    Supported: ip:port, ip:port:user:pass, user:pass@ip:port (optionally with http://
    or socks5:// in front). Credentials are never inspected, so a password may
    contain ':' or '@'.
    """
    if "://" in line:
        line = line.split("://", 1)[1]
    first = line.split(":", 1)[0]
    try:
        return ipaddress.IPv4Address(first)        # ip:port[:user:pass]
    except ValueError:
        pass
    if "@" in line:
        hostport = line.rsplit("@", 1)[1]           # user:pass@ip:port
        return ipaddress.IPv4Address(hostport.split(":", 1)[0])
    raise ValueError("no IPv4 address at the start of the line")


def read_ips(path):
    ips, bad = [], []
    with open(path) as fh:
        for n, line in enumerate(fh, 1):
            line = line.strip()
            if not line or line.startswith("#"):
                continue
            try:
                ips.append(parse_host(line))
            except ValueError:
                # Only the line number is reported: the line may hold credentials.
                bad.append(n)
    return ips, bad


def cymru_lookup(ips, timeout=15):
    """Bulk whois to Team Cymru: returns {ip: [(asn, bgp_prefix, as_name), ...]}.

    An IP can have more than one origin AS, so every row is kept.
    """
    query = "begin\nverbose\n" + "\n".join(str(ip) for ip in ips) + "\nend\n"
    out = b""
    with socket.create_connection(("whois.cymru.com", 43), timeout=timeout) as s:
        s.sendall(query.encode())
        while True:
            chunk = s.recv(65536)
            if not chunk:
                break
            out += chunk
    result = defaultdict(list)
    for row in out.decode(errors="replace").splitlines():
        cols = [c.strip() for c in row.split("|")]
        if len(cols) < 7 or cols[0] == "AS":
            continue
        result[cols[1]].append((cols[0], cols[2], cols[6]))
    return result


def audit(path, asn=True):
    try:
        ips, bad = read_ips(path)
    except OSError as e:
        sys.exit(f"Cannot read {path}: {e}")
    unique = sorted(set(ips))
    blocks = defaultdict(list)
    for ip in unique:
        blocks[ipaddress.ip_network(f"{ip}/24", strict=False)].append(ip)

    print(f"Entries processed: {len(ips) + len(bad)}  IPv4 proxies: {len(ips)}  "
          f"unique: {len(unique)}  duplicates: {len(ips) - len(unique)}  skipped: {len(bad)}")
    if bad:
        print(f"  skipped lines (no IPv4 address found): {', '.join(map(str, bad))}")
    print(f"Distinct /24 blocks: {len(blocks)}")
    sixteens = {ipaddress.ip_network(f"{ip}/16", strict=False) for ip in unique}
    print(f"Distinct /16 ranges: {len(sixteens)}")

    info = {}
    if asn and unique:
        try:
            # Sampled: one IP per /24. Routing can differ inside a block, so treat
            # the result as the block's usual origin, not a guarantee for every IP.
            info = cymru_lookup([b[0] for b in blocks.values()])
        except OSError as e:
            print(f"ASN lookup failed ({e}); rerun with --no-asn")

    print(f"\n{'/24 block':<18} {'IPs':>4} {'Fill':>7}  {'ASN':<8} {'BGP prefix':<18} AS name")
    for net, members in sorted(blocks.items(), key=lambda kv: -len(kv[1])):
        rows = info.get(str(members[0])) or [("?", "?", "?")]
        fill = f"{len(members)}/256"
        for i, (a, prefix, name) in enumerate(rows):
            label = (f"{str(net):<18} {len(members):>4} {fill:>7}" if i == 0 else " " * 31)
            print(f"{label}  {a:<8} {prefix:<18} {name[:40]}")

    asns = {a for rows in info.values() for a, _, _ in rows if a.isdigit()}
    if asns:
        print(f"\nDistinct origin ASNs: {len(asns)} ({', '.join(sorted(asns))})")
    if blocks:
        biggest = max(len(m) for m in blocks.values())
        print(f"\nLargest share in one /24: {biggest}/{len(unique)} IPs "
              f"({biggest / len(unique):.1%}) -> if a target limits that whole /24, this share is affected together.")


if __name__ == "__main__":
    if len(sys.argv) < 2:
        print(__doc__)
        sys.exit(1)
    if sys.argv[1] == "table":
        cidr_table()
    else:
        audit(sys.argv[1], asn="--no-asn" not in sys.argv)

Test 1: a mixed list with public resolver IPs

To show the ASN lookup without exposing anyone's proxies, we used well-known public DNS resolver addresses formatted like a proxy list, plus a duplicate, a broken line, an IPv6 address and three tricky credential formats (a password containing @, one containing what looks like a second IP, and an http:// prefix). Run on 31 October 2026, Python 3.8.10:

$ python3 subnet_audit.py sample.txt
Entries processed: 14  IPv4 proxies: 12  unique: 11  duplicates: 1  skipped: 2
  skipped lines (no IPv4 address found): 11, 12
Distinct /24 blocks: 10
Distinct /16 ranges: 8

/24 block           IPs    Fill  ASN      BGP prefix         AS name
203.0.113.0/24        2   2/256  NA       NA                 NA
1.0.0.0/24            1   1/256  13335    1.0.0.0/24         CLOUDFLARENET - Cloudflare, Inc., US
1.1.1.0/24            1   1/256  13335    1.1.1.0/24         CLOUDFLARENET - Cloudflare, Inc., US
8.8.4.0/24            1   1/256  15169    8.8.4.0/24         GOOGLE - Google LLC, US
8.8.8.0/24            1   1/256  15169    8.8.8.0/24         GOOGLE - Google LLC, US
9.9.9.0/24            1   1/256  19281    9.9.9.0/24         QUAD9-AS-1 - Quad9, US
149.112.112.0/24      1   1/256  19281    149.112.112.0/24   QUAD9-AS-1 - Quad9, US
192.0.2.0/24          1   1/256  NA       NA                 NA
208.67.220.0/24       1   1/256  36692    208.67.220.0/24    CISCO-UMBRELLA - Cisco OpenDNS, LLC, US
208.67.222.0/24       1   1/256  36692    208.67.222.0/24    CISCO-UMBRELLA - Cisco OpenDNS, LLC, US

Distinct origin ASNs: 4 (13335, 15169, 19281, 36692)

Largest share in one /24: 2/11 IPs (18.2%) -> if a target limits that whole /24, this share is affected together.

What it shows: the passwords with @ in them didn't confuse the parser (it counted 203.0.113.7 and 203.0.113.8, not the fake IP inside the password); the broken line and the IPv6 line were skipped by line number only; the documentation addresses returned NA and are not counted as an ASN. The BGP prefix column shows that each of these resolver services announces this space as a /24. On your own list, a BGP prefix shorter than /24 (for example /20) means your /24 sits inside a larger announced range.

Test 2: a concentrated list

Here we generated 100 IPs from the three documentation ranges (RFC 5737), deliberately clustered, and ran it offline:

$ python3 subnet_audit.py concentrated.txt --no-asn
Entries processed: 100  IPv4 proxies: 100  unique: 100  duplicates: 0  skipped: 0
Distinct /24 blocks: 3
Distinct /16 ranges: 3

/24 block           IPs    Fill  ASN      BGP prefix         AS name
198.51.100.0/24      60  60/256  ?        ?                  ?
203.0.113.0/24       30  30/256  ?        ?                  ?
192.0.2.0/24         10  10/256  ?        ?                  ?

Largest share in one /24: 60/100 IPs (60.0%) -> if a target limits that whole /24, this share is affected together.

Sixty percent of this list sits in one block. If a target throttles 198.51.100.0/24 as a range, more than half the pool is affected at once, however clean each individual IP is.

What the numbers mean

The script measures what's in your list: how many addresses, how they're grouped, and the routing data for each block. It can't prove who else uses a block; for that you need your provider's answer.

What the audit showsWhat it meansWhat to do
Many /24s, a few IPs eachYour pool is spread out; a range-level decision on one block affects a small shareGood for jobs that need many independent IPs
A large share in one or a few /24sYour pool is concentratedFine if the blocks are dedicated to you; ask your provider whether other customers use the same blocks
Close to a full block (e.g. 255/256)You hold almost every address in that /24Ask the provider to confirm the block is dedicated to your account
BGP prefix shorter than /24Your /24 is part of a larger announced rangeNormal for carrier space
Origin network isn't the one you expectedRouting attribution differs from what you were soldLook up a few IPs with our IP lookup tool and ask the provider. An ASN alone doesn't prove how an IP is used, but it should match the network you paid for
DuplicatesThe same IP appears more than onceYour real pool is smaller than the line count

Owning a whole /24: individual IPs vs dedicated subnets

SetupWhat you getStrengthWatch out for
CleanProxies ISP subnet: 1 × /24255 dedicated static ISP IPs from one blockOne block that only you use, one firewall rule to allow-list itA range-level decision affects the whole block; split work by project
CleanProxies ISP subnet: 4 × /241,020 dedicated IPs in four blocks, $1.19/IPThe lowest price per IP on the subnet plans, four separate blocks for segmentationPlan your split (for example one block per client)
CleanProxies ISP proxies (individual)Any quantity from 5 to 10,000 IPs, as low as $0.75/IPExactly the number of IPs you needYou don't hold whole blocks
Shared pool from a typical providerIPs in blocks other customers also useCheap to startOther users' traffic sits in the same blocks as yours

Why CleanProxies is the best place to get a dedicated /24

CleanProxies specialises in US ISP proxies on real carrier ranges, and the ISP subnet proxies plan is that network sold by the block:

  • Whole /24 blocks, 100% dedicated: 255 IPs per block, never shared with another customer while your plan is active. One, two or four blocks (255, 510 or 1,020 IPs).

  • Real carrier ranges on Tier-1 carrier ASNs: fixed-line US carriers such as Frontier, AT&T, Comcast, Cox, RCN and T-Mobile (fixed static IPs on its ranges), as available in the dashboard at checkout. Verify any block yourself with the script above.

  • The cleanest ISP IPs: 0 fraud score, super clean ranges. Spot-check any IP with the IP blacklist checker.

  • Static for the whole month: every IP stays the same for the 30-day billing period.

  • Unlimited bandwidth and threads on 100Gbps network ports, <20ms latency and 99.9% uptime.

  • Flexible authentication: username:password, IP whitelisting (1–20 IPv4 addresses), or SOCKS5 with user:pass via the switch in your dashboard.

  • Great 24/7 support from the team that runs the network.

  • The cheapest pricing in the market: ISP subnets as low as $1.19/IP, individual ISP proxies as low as $0.75/IP.

Good to know before you buy: ISP IPs can't be targeted by US state or city, and orders don't come with IP replacements or refunds, so test first (see below).

Which should you pick?

  • You need 255+ static IPs and want each client or project in its own block: take one or more dedicated /24s on ISP subnet proxies. Four blocks (1,020 IPs) give the lowest subnet price per IP.

  • You need fewer than about 250 IPs, or an exact number: take ISP proxies individually; you can add more at any time.

  • You need a different IP on every request or worldwide locations: that's a job for rotating residential proxies, not a static subnet.

Not sure about sizing? Our guide on how many proxies you need walks through it, and what ISP subnet proxies are explains the product in more depth. The glossary entry on the /24 subnet is the one-minute version of this page.

Testing checklist before you scale

  1. Count per /24. Run subnet_audit.py on any list you're evaluating: duplicates, number of /24s, IPs per block.

  2. Check the network. The origin network should be the ISP you expect. Cross-check with the IP lookup tool.

  3. Check reputation. Put a sample of IPs through the IP blacklist checker.

  4. Check that the proxy works. Use the proxy checker for status and latency, and our proxy quality testing guide for a full test.

  5. Try the service for $4.99. The $4.99 trial gives you 5 ISP proxies for 1 hour, so you can run steps 2–4 on real CleanProxies ISP IPs and see the dashboard before you order whole blocks. Trial IPs are individual proxies, not a /24, so check your subnet blocks again with the script once they're delivered.

Key stats

  • 256 addresses per /24; 254 usable on a LAN; 251 in an AWS or Azure subnet; 16,777,216 /24s in the full IPv4 space (2^24).

  • IPv4 prefixes longer than /24 are "generally neither announced nor accepted in the Internet" (RFC 7454, §6.1.3).

  • 1,088,532 IPv4 prefixes in the routing table on the CIDR Report dated 31 October 2026; 83% (7,780 of 9,406) of that week's added prefixes were /24s (CIDR Report).

  • /31 networks have 2 usable addresses on point-to-point links (RFC 3021).

  • 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for documentation (RFC 5737), which is why we use them in examples.

Pricing

ProductAs low asUnit
ISP subnet proxies (dedicated /24 blocks)$1.19/IP255, 510 or 1,020 IPs, monthly
ISP proxies$0.75/IPper IP, monthly
Rotating residential proxies$0.63/GBper GB, data never expires
Mobile proxies$0.79/GBper GB, data never expires

See every tier on the pricing page, or compare providers on /compare.

Get your own /24

Hold the whole block instead of sharing it: ISP subnet proxies give you dedicated /24s of US ISP IPs with unlimited bandwidth, as low as $1.19/IP. Start with the $4.99 trial, check the IPs with the proxy checker, then choose your plan.

Frequently Asked Questions

A /24 subnet contains 256 IPv4 addresses (2 to the power of 8), for example 203.0.113.0 to 203.0.113.255. Its subnet mask is 255.255.255.0.

On a normal LAN, 254: the .0 network address and the .255 broadcast address aren't assigned to devices. AWS and Azure reserve five addresses per subnet, leaving 251. Proxy providers set their own count; CleanProxies delivers 255 dedicated proxy IPs per /24.

255.255.255.0. The wildcard (inverse) mask is 0.0.0.255. The first 24 bits identify the network and the last 8 bits identify hosts.

A /22 holds four /24s (1,024 addresses) and a /16 holds 256 /24s (65,536 addresses). Each step to a shorter prefix doubles the size of the block.

The /24 is the smallest block normally routed on the internet and a common way to group neighbouring IPs, so some systems apply rate limits or blocks to a range. Counting your proxies per /24 shows how concentrated your pool is; a dedicated subnet means no other customer uses your block.

Yes. CleanProxies ISP subnet proxies are dedicated /24 blocks of US ISP IPs, sold as 255, 510 or 1,020 IPs, with unlimited bandwidth and prices as low as $1.19/IP. You can test the network first with the $4.99 trial (5 ISP proxies for 1 hour).

Team CleanProxies
Proxy Infrastructure Team
Tags
  • ISP Subnet Proxies
  • Networking
  • CIDR
  • ISP Proxies
  • Python

Related Articles