IP fundamentals

What is CIDR notation?

Classless Inter-Domain Routing describes address blocks using a prefix length rather than old address classes. A prefix groups addresses that share leading bits.

Updated

Read an IPv4 prefix

In 192.0.2.0/24, the first 24 of 32 bits are fixed. The remaining eight bits identify 256 possible addresses in the block. This describes the size of the range; usable host addresses depend on network type and allocation rules.

Read an IPv6 prefix

A prefix such as 2001:db8:1234::/48 fixes the first 48 of 128 bits. IPv6 subnets are often /64, but other prefix lengths are also used. Do not compare IPv4 and IPv6 prefix lengths as if the underlying address widths were identical.

Change the prefix length

Illustrative data · No network requests

192.0.2.37/24256 addresses
192
11000000
0
00000000
2
00000010
37
00100101
24 network bits8 host bits
Address block192.0.2.0–255
/24

256 total IPv4 addresses belong to this block.

Read all scenarios
  1. /24: 192.0.2.37 · 24 fixed / 8 host · 192.0.2.0–255. 256 total IPv4 addresses belong to this block.
  2. /27: 192.0.2.37 · 27 fixed / 5 host · 192.0.2.32–63. 32 addresses belong to the narrower block.
  3. /32: 192.0.2.37 · 32 fixed / 0 host · 192.0.2.37. A /32 represents a single IPv4 address.

Routing and lookup

Routers can use the most specific matching prefix among advertised routes. Geolocation providers also organize information by address ranges, although their data boundaries need not match routing prefixes. A public IP lookup is about the address supplied, not a scan of a subnet.

Avoid common mistakes

A CIDR block is not a hostname, and a prefix length is not a port. 192.0.2.10/24 may describe an interface address and its network prefix, but the bare IP lookup input is 192.0.2.10. Documentation prefixes should remain non-public in ordinary lookups.

Check your understanding

How many total IPv4 addresses are in a /27 block?

How many total IPv4 addresses are in a /27 block?

Working through a learning path?

Record your own progress on this browser. No account required.

Learning paths →

Try this

Read network prefixes to interpret address allocation, not to infer which devices are active. InspectMyIP accepts individual IP addresses and does not scan ranges.

IPv4 / IPv6 subnet calculator →

Technical references