16 Languages, One Live Classroom Cisco, Cyber & Cloud
HSR Sector 6 · Bangalore +91 96110 27980 Mon–Sat · 09:30–20:30
Networking Fundamentals · 7 min read · Updated 29 August 2026

CIDR notation explained: what /24, /26 and the rest actually mean

The number after the slash counts network bits from the left. In 192.168.1.0/24, the first 24 of the address's 32 bits identify the network; the remaining 8 are yours for hosts. Everything else — the mask, the host count, the broadcast address — is arithmetic on that one number.

CIDR is short for Classless Inter-Domain Routing, which is an unhelpful name for something quite simple. The thing to hold onto is that a prefix is a boundary: it says where the network part of an address stops and the host part begins. Move the boundary left and you get fewer, larger networks. Move it right and you get more, smaller ones.

Where the boundary sits

An IPv4 address is 32 bits, written as four 8-bit octets in decimal because humans are bad at reading 32 binary digits. The prefix simply marks a cut point in that bit string.

The /26 boundary inside a 32-bit IPv4 address 192.168.1.0/26 shown in binary: the first 26 bits are network, the final 6 bits are host, giving 64 addresses of which 62 are usable. 192.168.1.0/26 11000000.10101000.00000001.00 000000 26 network bits 6 host bits the boundary 32 − 26 = 6 host bits → 2⁶ = 64 addresses → 64 − 2 = 62 usable hosts Mask 255.255.255.192 · network .0 · broadcast .63 · usable .1 to .62
The mask is the same picture in decimal: 26 one-bits then 6 zero-bits is 255.255.255.192.

Doing it in your head

In an exam, and in a change window at eleven at night, you will not have a calculator. Three steps get you everything:

  1. Host bits = 32 − prefix. A /27 leaves 5.
  2. Block size = 2host bits. 25 = 32. This is also how far apart consecutive subnets sit, which is the number you actually use most.
  3. Usable hosts = block size − 2. 32 − 2 = 30.

The block size is the one worth internalising. For a /27, subnets start at .0, .32, .64, .96 and so on. Asked which subnet 192.168.1.100/27 belongs to, you count up in 32s — 0, 32, 64, 96 — stop before passing 100, and the answer is 192.168.1.96/27, broadcast .127. No binary conversion required.

The mask octet is 256 minus the block size. Block size 32 gives 224, so a /27 is 255.255.255.224. That subtraction saves you from memorising the mask column entirely.

The prefixes you will actually meet

PrefixMaskAddressesUsableTypical use
/24255.255.255.0256254A standard office LAN
/25255.255.255.128128126Splitting a /24 in two
/26255.255.255.1926462Departmental segments
/27255.255.255.2243230Small branch VLANs
/30255.255.255.25242Point-to-point WAN links
/31255.255.255.25422Point-to-point, RFC 3021
/32255.255.255.25511A single host — loopbacks, ACL matches

That is the working set. For every prefix from /1 to /32 with wildcard masks alongside, use the subnet mask cheat sheet.

Two entries surprise people. A /31 gives two usable addresses rather than zero — RFC 3021 dispensed with network and broadcast addresses on point-to-point links, where nobody needs them, so a serial or routed link can use a /31 instead of wasting half a /30. And a /32 is a single address: that is what a loopback interface carries, and what an ACL means when it matches one host.

Why classes had to go

Before 1993, the boundary could only sit at /8, /16 or /24 — Class A, B or C — decided by the address's leading bits. An organisation needing 300 addresses did not fit a Class C's 254, so it was allocated a Class B: 65,534 addresses, of which roughly 65,200 sat unused forever. Multiply that across every mid-sized company on the internet and you can see why IPv4 exhaustion arrived decades early.

CIDR let the boundary land anywhere, so that organisation now gets a /23 — 510 addresses, roughly what it asked for. Just as importantly it enabled aggregation: a provider holding sixteen consecutive /24s can advertise them upstream as one /20, so the global routing table carries one entry instead of sixteen. Without that, internet routers would have run out of memory long ago.

Where you will type it

Cisco IOS is inconsistent about this, which trips up newcomers. Interface addressing wants a dotted-decimal mask; most other commands want a prefix:

R1(config)# interface GigabitEthernet0/1
R1(config-if)# ip address 192.168.1.1 255.255.255.192      ← dotted-decimal here

R1(config)# ip route 10.20.0.0 255.255.0.0 192.168.1.2     ← and here

R1# show ip route
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/26 is directly connected, GigabitEthernet0/1   ← prefix here

Cloud consoles, firewall rules and ACL summarisation all use prefix notation, so in practice you convert between the two constantly. Hence the 256-minus-block-size trick.

Frequently asked

What does the slash number in CIDR notation mean?

It is the count of bits, from the left, that identify the network. In 192.168.1.0/24 the first 24 bits are the network and the remaining 8 are available for hosts. An IPv4 address is 32 bits, so the host portion is always 32 minus the prefix. That single subtraction is the whole system: /24 leaves 8 host bits, /26 leaves 6, /30 leaves 2.

How do I work out how many hosts a prefix allows?

Take 2 to the power of the host bits, then subtract 2. A /26 has 32 minus 26 equals 6 host bits, so 2 to the power of 6 is 64 addresses, minus 2 gives 62 usable hosts. The two you lose are the network address, where all host bits are zero, and the broadcast address, where all host bits are one. The exception is /31, defined by RFC 3021 for point-to-point links, which uses both addresses and gives you 2 usable hosts.

What is the difference between CIDR notation and a subnet mask?

They express exactly the same information in two formats. /24 and 255.255.255.0 are the same statement: 24 leading one-bits followed by 8 zero-bits. CIDR notation is shorter to write and is what routing tables, firewall rules and cloud consoles use; dotted-decimal masks are what Cisco IOS interface configuration expects. You need to be fluent in both because a single working session will use both.

Why did classful addressing get replaced by CIDR?

Because classes wasted enormous amounts of address space. Under the old system an organisation needing 300 addresses was too big for a Class C, which gave 254, so it received a Class B with 65,534 — leaving over 65,000 addresses stranded. CIDR, standardised in 1993, removed the fixed class boundaries and let the prefix land anywhere, so that organisation gets a /23 with 510 addresses instead. It also allowed route aggregation, which is what stopped the global routing table from growing beyond what routers could hold.

Does CIDR notation work the same way for IPv6?

The mechanism is identical — the prefix counts network bits from the left — but the scale and the conventions differ. IPv6 addresses are 128 bits rather than 32, and there are no dotted-decimal masks at all, so CIDR notation is the only way prefixes are written. Common values are /48 for a site allocation, /56 for a subscriber, and /64 for a single subnet. A /64 is effectively standard for any LAN because IPv6 stateless address autoconfiguration expects 64 host bits.

Addressing and subnetting are the largest slice of CCNA Network Fundamentals. Continue with IP addressing and subnetting, the subnet mask cheat sheet, and wildcard masks — the inverted form ACLs and OSPF use.

Want practice rather than theory? Work through CCNA subnetting practice.