Skip to content
Get Started
G2G2
4.7/5
Excellent
Trustpilot

What Is a Subnet Mask?

A subnet mask is a 32-bit number that marks which part of an IPv4 address identifies the network and which part identifies the device. The common mask 255.255.255.0 means the first three numbers name the network and the last number names the host, the same as /24 in CIDR notation.

  • Session Control
  • High Speed
  • Privacy First
Best fit for Subnet maskISP Subnet Proxiesfrom$1.19/IP
how it works

How a subnet mask works

Written in binary, a mask is a run of 1s followed by 0s. The 1s cover the network bits and the 0s cover the host bits. A device applies a bitwise AND between its address and the mask to get the network address: 192.168.1.37 AND 255.255.255.0 gives 192.168.1.0. Any destination with the same network address is reached directly; anything else goes to the default gateway.

CIDR notation counts the 1s instead of spelling the mask out, so 255.255.255.0 is /24 and 255.255.0.0 is /16. On a local network the first address (network) and the last (broadcast) are reserved, which is why the usable host count is two less than the block size.

  • 1

    255.255.0.0

    CIDR
    /16
    Usable hosts on a LAN
    65,534
  • 2

    255.255.255.0

    CIDR
    /24
    Usable hosts on a LAN
    254
  • 3

    255.255.255.128

    CIDR
    /25
    Usable hosts on a LAN
    126
  • 4

    255.255.255.192

    CIDR
    /26
    Usable hosts on a LAN
    62
  • 5

    255.255.255.248

    CIDR
    /29
    Usable hosts on a LAN
    6
  • 6

    255.255.255.252

    CIDR
    /30
    Usable hosts on a LAN
    2
try it

Check a mask in Python

Python's standard ipaddress module does the arithmetic for you, which helps when you write allowlists or check whether an address falls inside a range:

Network, mask and membershipPython
import ipaddress

net = ipaddress.ip_interface("192.168.1.37/255.255.255.0").network
print(net)                 # 192.168.1.0/24
print(net.netmask)         # 255.255.255.0
print(net.num_addresses)   # 256
print(ipaddress.ip_address("192.168.1.200") in net)  # True
print(ipaddress.ip_address("192.168.2.10") in net)   # False
why it matters

Why subnet masks matter for proxy users

Websites and firewalls think in ranges as much as single addresses, and ranges are written with masks or CIDR prefixes.

CleanProxies ISP subnet proxies are whole dedicated /24 blocks of US carrier IPs, from $1.19 per IP, so no neighbour shares your range.

Subnet mask: what it means for you
  • Anti-abuse systems often rate-limit or block a whole /24 when several addresses in it misbehave, so neighbours on a shared range affect you.
  • Partners and APIs can allowlist a whole proxy block with one entry such as 203.0.113.0/24 instead of 256 lines.
  • A mask of 255.255.255.255 (/32) means exactly one address, which is how single IPs are written in most allowlist fields.

ISP subnet proxies from $1.19/IP

The CleanProxies proxy that fits best here, with a $4.99 trial to test it first.

Whole dedicated /24 blocks of US carrier IPs with unlimited bandwidth.

starting from$1.19/IP

Whole /24 blocks of static ISP IPs (255, 510 or 1,020 addresses) reserved for one customer, for large fleets of long-lived sessions.

Guides from the blog

Setup guides and best practices from the CleanProxies blog.

Get the latest insightsAll Blogs

Related terms

Terms that come up alongside Subnet mask.

All glossary terms

Subnet mask FAQs

Straight answers about Subnet mask.

The first three numbers of the address identify the network and the last number identifies the device. It equals /24 in CIDR and gives 256 addresses, 254 of them usable hosts on a local network.

Got more questions?All FAQs