Find your IP

CIDR notation explained

The slash and number after an IP address, as in 203.0.113.0/24, say how big a block of addresses is. Here is how to read it, a chart of every IPv4 prefix length, and what the same notation means in IPv6.

In this guide
Short answer

CIDR notation writes a network as an address followed by a slash and a prefix length, for example 203.0.113.0/24. The number is how many bits from the left identify the network; the remaining bits identify hosts within it. A /24 has 8 host bits, so 256 addresses (254 usable), and corresponds to the subnet mask 255.255.255.0. A /32 is a single address.

How to read CIDR notation

An IPv4 address is 32 bits, usually written as four numbers from 0 to 255. CIDR notation adds a slash and a count: how many of those bits, starting from the left, are fixed for everything in the block. The rest are free to vary, and each combination of the free bits is one address.

The address 203.0.113.42/24 split into its 24 network bits, which identify the block 203.0.113.0, and its 8 host bits, which identify host 42 within it.203 . 0 . 113. 4224 network bits: the block 203.0.113.0/248 host bits: host 42203.0.113.42/24mask 255.255.255.0256 addresses, 254 usable
The number after the slash says how many bits from the left name the network. The rest name the host.

So 203.0.113.0/24 means: the first 24 bits (203.0.113) are fixed, the last 8 bits vary, and the block runs from 203.0.113.0 to 203.0.113.255. The first address of any block is its network address and the last is its broadcast address, so on an ordinary LAN two of the 256 are not usable by hosts, leaving 254.

The address before the slash is normally the start of the block, with all host bits zero. When it is not, as in 203.0.113.42/24, the notation describes a host and the block it sits in: host 42 of the 203.0.113.0/24 network. Both forms are common. Configuration files use the host form (192.168.1.23/24 on an interface); routing tables and firewall rules use the block form.

Three rules make the arithmetic quick:

  • Every bit you add to the prefix halves the block; every bit you remove doubles it. A /25 is half a /24; a /23 is two /24s.
  • The number of addresses is 2 to the power of (32 minus the prefix). A /26 has 2⁶ = 64.
  • Blocks start on multiples of their own size. A /26 can start at .0, .64, .128 or .192, never at .100, which is why 203.0.113.100/26 describes a host inside 203.0.113.64/26, not a block starting at .100.

The slash number and the subnet mask are the same information in two spellings. A mask is the prefix written out as 32 bits: /24 is twenty-four ones followed by eight zeros, which in dotted form is 255.255.255.0. What is a subnet mask? goes through the conversion; the subnet calculator does it for you and also prints the network, broadcast and usable range.

CIDR stands for Classless Inter-Domain Routing. It replaced the original scheme of fixed Class A, B and C sizes in 1993 for two reasons: blocks could be sized to need instead of being wasted, and a provider could announce one summary route for all its customers instead of hundreds. The IP address classes guide covers what it replaced and where the old vocabulary still turns up.

CIDR chart: /8 to /32

Usable hosts assumes an ordinary subnet with a network and a broadcast address. Two special cases: a /31 is used on point-to-point links with both addresses usable, and a /32 is a single host.

PrefixSubnet maskAddressesUsable hostsTypical use
/8255.0.0.016,777,21616,777,214A whole former Class A; 10.0.0.0/8 is the private one
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302100.64.0.0/10 is the carrier-grade NAT range
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574172.16.0.0/12 is the middle private range
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/16255.255.0.065,53665,534A former Class B; 192.168.0.0/16 and 169.254.0.0/16
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022A common small-ISP or campus allocation
/23255.255.254.0512510Two /24s joined
/24255.255.255.0256254The typical home or office LAN; a former Class C
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614A small block of public addresses for a business
/29255.255.255.24886Typical static-IP business line
/30255.255.255.25242Point-to-point links, older style
/31255.255.255.25422Point-to-point links; no network or broadcast address
/32255.255.255.25511A single host; what firewall rules and route tables use

Prefixes shorter than /8 exist but describe aggregates rather than networks: 0.0.0.0/0 is "every address", which is how a default route is written, and regional registries hold blocks such as /8s to carve up for providers. The CIDR to IP range converter turns any block into its first and last address, and back.

Worked examples

A home network. The router says its LAN is 192.168.1.0/24. Hosts can use 192.168.1.1 through 192.168.1.254; the router usually takes .1, and 192.168.1.255 is the broadcast address. The local IP tool shows which of those your device holds.

Splitting a block. A company with 198.51.100.0/24 wants four separate networks. Four is 2², so it borrows 2 host bits and gets four /26s: 198.51.100.0/26, .64/26, .128/26 and .192/26, each with 62 usable addresses.

Joining blocks. An office uses 192.168.0.0/24 and 192.168.1.0/24 and wants them to be one network. They are adjacent and the first starts on an even boundary, so together they are 192.168.0.0/23: 512 addresses, one subnet. Providers do the same at a larger scale, announcing one summary route for all their customers' blocks; that is the aggregation CIDR was designed for.

A firewall rule. "Allow SSH from 203.0.113.42/32" permits exactly one address. "Allow from 203.0.113.0/24" permits all 256. Writing /32 rather than the bare address is a habit worth keeping, because some tools treat a bare address with a missing prefix as a /0 and allow everyone.

A lookup result. When the IP lookup or WHOIS shows that an address belongs to the block 203.0.113.0/25, every address from 203.0.113.0 to 203.0.113.127 has the same owner, which is what tells you that two different-looking addresses came from one network.

Test it now

Cloudflare edge
IP websites see216.73.216.52
LocationColumbus, United States
Internet providerAnthropic, PBC

Read at the Cloudflare edge from this request. The homepage adds your provider, network type and the VPN, DNS and WebRTC checks.

Show details

IPv6 prefixes

IPv6 uses the same slash notation on 128-bit addresses, so the numbers are bigger and the habits are different. Nobody counts usable hosts in IPv6; a single subnet is a /64 with 2⁶⁴ addresses, and address autoconfiguration requires that size. Prefixes describe how many subnets you have, not how many hosts.

PrefixWhat it usually is
/128A single address, the IPv6 equivalent of /32
/127A point-to-point link between two routers
/64One subnet: one LAN, one Wi-Fi network, one VLAN
/56A common home assignment: 256 subnets of /64
/48A common business or campus assignment: 65,536 subnets
/32 and shorterWhat registries allocate to internet providers
2000::/3The range from which all current global addresses are assigned
fe80::/10Link-local addresses, present on every interface
2001:db8::/32Reserved for documentation and examples

The number itself is the only thing that carries over cleanly: a shorter prefix is still a bigger block, each bit still halves or doubles it, and the subnet calculator handles both families. What changes is scale. A home that got a single /24 in IPv4, 254 addresses, typically gets a /56 in IPv6, which is 256 networks each larger than the entire IPv4 internet. The IPv6 test shows whether your connection has one, and IPv4 vs IPv6 explains the rest of the differences.

Questions

Can you explain CIDR for a beginner?

Think of an address as a street name plus a house number. CIDR's slash number says how much of the address is the street. In 192.168.1.0/24, the first three numbers are the street and the last number is the house, so the street has 256 possible houses. A bigger slash number means a shorter street with fewer houses; /32 is one house on its own.

What does /24 mean in CIDR notation?

That the first 24 of the 32 bits are the network part, leaving 8 bits, or 256 addresses, for hosts, of which 254 are usable. It corresponds to the subnet mask 255.255.255.0, and it is the size of a typical home or office network: 192.168.1.0/24 covers 192.168.1.0 through 192.168.1.255, with .0 as the network address and .255 as broadcast.

What does a /32 CIDR mean?

A block containing exactly one address: all 32 bits are fixed, so nothing can vary. The mask is 255.255.255.255. You see it in firewall rules and routing tables where a single host is meant, for example "allow 203.0.113.42/32". In IPv6 the equivalent is /128; an IPv6 /32 is a huge allocation given to an internet provider, not one host.

What is 255.255.255.255 in CIDR?

/32. The mask has all 32 bits set, so every bit of the address is network and none is host, which leaves a single address. The other common masks map the same way: 255.255.255.0 is /24, 255.255.0.0 is /16, 255.0.0.0 is /8, and 255.255.255.252 is /30. Count the one-bits in the mask and you have the prefix length.

What does CIDR notation represent?

A range of IP addresses that share a common beginning, written as the first address plus the number of shared bits. It represents networks, allocations and rules compactly: 10.0.0.0/8 is sixteen million addresses in nine characters. It also replaced the old class system, letting blocks be any power-of-two size and letting providers announce one route for many customers.

Sources and further reading

  1. RFC 4632: Classless Inter-domain Routing (CIDR)
  2. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
  3. RFC 6177: IPv6 Address Assignment to End Sites
CheckMyIP Team
Network engineers and privacy researchers