PublicIPChecker

Guide

Subnet masks and CIDR explained

6 min read · Updated 2026-10-06

A subnet mask splits an IP address into network and host parts. Learn to read 255.255.255.0 and /24, and count addresses per prefix.

A subnet mask looks like a second IP address, and most people ignore it until something breaks. It answers a simple question every device asks before sending a packet: is the destination on my network, or do I send it to the router?

What a subnet mask does

An IP address has two parts: the network portion, shared by every device on the segment, and the host portion, unique per device. The mask marks where the split happens.

Take 192.168.1.24 with mask 255.255.255.0. Written as bits, the first 24 bits are 1s (network) and the last 8 are 0s (host). So the network is 192.168.1.0 and this device is host 24. Anything else in 192.168.1.x is a neighbour reached directly through the switch; anything else is handed to the default gateway — the router's IP.

CIDR notation

Instead of writing 255.255.255.0, the world writes /24 — the number of leading 1 bits. CIDR (Classless Inter-Domain Routing) also allows blocks that do not sit on old octet boundaries, such as /22 or /26, which is how ISPs carve addresses efficiently.

Two addresses in every block are special: the network address (all host bits zero) and the broadcast address (all host bits one), which is why usable hosts are always two fewer than the raw count. Modern point-to-point links can use /31, and a single host is /32.

Prefix cheat sheet

CIDRMaskTotal addressesUsable hostsTypical use
/30255.255.255.25242Point-to-point router links
/29255.255.255.24886Small DMZ segments
/28255.255.255.2401614Server racks
/24255.255.255.0256254Home and small-office LANs
/16255.255.0.065,53665,534Large campuses, Docker networks
/8255.0.0.016,777,21616,777,214Very large private networks

IPv6 uses the same notation but with an important convention: end-user networks are almost always /64, leaving 64 bits for host addressing, because stateless autoconfiguration and privacy extensions assume it. A typical home connection is delegated a /56 or /48, i.e. 256 or 65,536 separate /64 subnets.

Private and special ranges to recognise

RangeCIDRWhat it is
10.0.0.0 – 10.255.255.25510.0.0.0/8Private (RFC 1918) — most common on business and ISP-managed gear
172.16.0.0 – 172.31.255.255172.16.0.0/12Private (RFC 1918) — Docker's default bridge lives here
192.168.0.0 – 192.168.255.255192.168.0.0/16Private (RFC 1918) — home routers
100.64.0.0 – 100.127.255.255100.64.0.0/10Carrier-grade NAT — you share this with strangers
127.0.0.0 – 127.255.255.255127.0.0.0/8Loopback — your own device
169.254.0.0 – 169.254.255.255169.254.0.0/16Link-local — the "APIPA" address Windows shows when DHCP fails

If your device shows 169.254.x.x, it never got an address from the router. That, not the internet, is why nothing loads — a faster diagnosis than anything a call centre will give you.

Why it matters even if you never subnet anything

  • Reading network settings. "Router 192.168.1.1, device 192.168.1.24, mask 255.255.255.0" now tells you the whole neighbourhood at a glance.
  • Spotting the private/public split. Any 10., 172.16–31. or 192.168. value is local, not internet-facing — see public vs private IP.
  • Recognising CGNAT at a glance, which explains failed port forwards and shared reputation.
  • Setting up a guest network or VLAN without accidentally merging it into the main one.
  • Working with cloud and container networks, where CIDR blocks are used for security-group rules and VPN routes.

Bottom line: the mask is a map of where your network ends. Read it and you can tell whether a device will talk directly to a neighbour or send the packet to the router — and you can spot the private, loopback and CGNAT ranges that explain a surprising amount of everyday network behaviour.

Frequently asked questions

What does /24 mean in an IP address?

It is CIDR shorthand for a subnet mask of 255.255.255.0: 24 network bits, 8 host bits, 256 total addresses and 254 usable hosts. Home routers almost always use /24.

How many IP addresses are in a /24?

256 total, of which 254 can be assigned to hosts. The network address and the broadcast address are reserved.

What is the subnet mask of 192.168.1.1?

Whatever the network is configured with — overwhelmingly 255.255.255.0 (/24) on consumer routers, which is why devices get addresses in 192.168.1.2–254.


Keep reading

Check any other IP address

Investigating a suspicious login, a spam email header or a server log entry? Run any IPv4 or IPv6 address through the same geolocation and proxy checks.