NetCalcLab

CIDR Reference Table

Every prefix from /0 to /32 with its subnet mask, wildcard mask, total addresses, usable hosts and block size — plus links to a dedicated page for each commonly used prefix.

Accepts /24, a bare 24, a dotted subnet mask such as 255.255.255.0, or a wildcard mask such as 0.0.0.255.

Examples:

Complete CIDR reference table

Every valid IPv4 prefix from /0 to /32 with its mask, wildcard and address counts.

CIDR to subnet mask reference table
PrefixSubnet maskWildcardTotal addressesUsable hostsBlock size
/00.0.0.0255.255.255.2554,294,967,2964,294,967,2944,294,967,296
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,6462,147,483,648
/2192.0.0.063.255.255.2551,073,741,8241,073,741,8221,073,741,824
/3224.0.0.031.255.255.255536,870,912536,870,910536,870,912
/4240.0.0.015.255.255.255268,435,456268,435,454268,435,456
/5248.0.0.07.255.255.255134,217,728134,217,726134,217,728
/6252.0.0.03.255.255.25567,108,86467,108,86267,108,864
/7254.0.0.01.255.255.25533,554,43233,554,43033,554,432
/8255.0.0.00.255.255.25516,777,21616,777,21416,777,216
/9255.128.0.00.127.255.2558,388,6088,388,6068,388,608
/10255.192.0.00.63.255.2554,194,3044,194,3024,194,304
/11255.224.0.00.31.255.2552,097,1522,097,1502,097,152
/12255.240.0.00.15.255.2551,048,5761,048,5741,048,576
/13255.248.0.00.7.255.255524,288524,286524,288
/14255.252.0.00.3.255.255262,144262,142262,144
/15255.254.0.00.1.255.255131,072131,070131,072
/16255.255.0.00.0.255.25565,53665,53465,536
/17255.255.128.00.0.127.25532,76832,76632,768
/18255.255.192.00.0.63.25516,38416,38216,384
/19255.255.224.00.0.31.2558,1928,1908,192
/20255.255.240.00.0.15.2554,0964,0944,096
/21255.255.248.00.0.7.2552,0482,0462,048
/22255.255.252.00.0.3.2551,0241,0221,024
/23255.255.254.00.0.1.255512510512
/24255.255.255.00.0.0.255256254256
/25255.255.255.1280.0.0.127128126128
/26255.255.255.1920.0.0.63646264
/27255.255.255.2240.0.0.31323032
/28255.255.255.2400.0.0.15161416
/29255.255.255.2480.0.0.7868
/30255.255.255.2520.0.0.3424
/31255.255.255.2540.0.0.122 (RFC 3021)2
/32255.255.255.2550.0.0.0111

Quick reference: mask to prefix

Reading a mask written in dotted-decimal form. Count the 1 bits, or use the octet boundaries below.

Subnet mask to CIDR prefix lookup
Subnet maskPrefixWildcardUsable hostsBlock size
255.255.255.128/250.0.0.128126128
255.255.255.192/260.0.0.646264
255.255.255.224/270.0.0.323032
255.255.255.240/280.0.0.161416
255.255.255.248/290.0.0.868
255.255.255.252/300.0.0.424
255.255.255.254/310.0.0.202
255.255.255.255/320.0.0.101

Example: 255.255.255.224 has three 1 bits in its last octet, so the prefix is 24 + 3 = /27, the wildcard is 0.0.0.31 and there are 32 addresses of which 30 are usable.

How to read the table

Each row answers the three questions you have while configuring: what mask do I type, how many hosts does this give me, and where does the next subnet start. The prefix length is the single number that determines all of it.

The four derived quantities
ColumnFormulaWhat it tells you
Subnet maskprefix ones then (32 − prefix) zerosWhat to type on the interface
Wildcard maskbitwise inverse of the maskWhat to put in a Cisco ACL or OSPF statement
Total addresses2^(32 − prefix)The size of the block
Usable hosts2^(32 − prefix) − 2How many devices you can address
Block size2^(32 − prefix)The spacing between consecutive subnets

The binary mask column is there because counting the ones is the most reliable way to verify a mask is contiguous. A valid mask has no zeros between ones.

The prefixes you will actually use

Four sizes cover the overwhelming majority of real configurations, so it is worth memorising them outright:

  • /24 — 254 hosts. The default LAN or VLAN size. Mask 255.255.255.0, wildcard 0.0.0.255, block size 256.
  • /25 and /26 — 126 and 62 hosts. Used to split a /24 into two or four segments, usually to separate departments or to contain broadcast domains.
  • /30 — 2 hosts. The classic WAN transit link. Mask 255.255.255.252, wildcard 0.0.0.3, block size 4.
  • /31 — 2 addresses, no waste. The modern point-to-point link per RFC 3021. Mask 255.255.255.254, wildcard 0.0.0.1.

Everything between /17 and /23 appears in campus and branch designs, and everything below /16 appears in ISP and cloud allocations. The CIDR calculator handles the full range interactively if you need to convert a mask the table does not cover.

Subnets within a subnet

The easiest way to check an allocation is to count how many smaller blocks fit inside a larger one. The rule is to subtract the prefix lengths and raise two to that power: a /24 fits inside a /16 exactly 2^8 = 256 times.

How many smaller subnets fit in a larger one
ParentChildPrefix differenceCount
/16/248 bits256
/16/226 bits64
/20/244 bits16
/22/275 bits32
/24/262 bits4
/24/273 bits8
/24/306 bits64
/24/317 bits128
/25/305 bits32
/26/293 bits8

This table is what makes VLSM planning tractable: you are repeatedly asking how many child blocks of a given size fit in the space remaining. The VLSM planner applies the same arithmetic automatically across a whole requirement list.

Common mistakes

  • Subtracting two from a /31 or /32. Those prefixes have no network and broadcast address, so the usable count is 2 and 1 respectively, not 0 and −1.
  • Placing a subnet off its block boundary. A /27 must start on a multiple of 32. 192.168.1.16/27 is valid; 192.168.1.20/27 is not, and most routers will reject it.
  • Using the wildcard where the mask belongs. They are complements, and swapping them silently matches the wrong traffic in an ACL.
  • Forgetting that a /0 has 2^32 addresses. The count needs 64-bit arithmetic; code using a 32-bit shift produces zero or an overflow.

Full CIDR table

The most frequently used prefixes, with the mask, wildcard, counts and binary mask.

CIDR reference for common prefix lengths
PrefixSubnet maskWildcardTotal addressesUsable hostsBlock sizeBinary mask
/8255.0.0.00.255.255.25516,777,21616,777,21416,777,21611111111.00000000.00000000.00000000
/16255.255.0.00.0.255.25565,53665,53465,53611111111.11111111.00000000.00000000
/20255.255.240.00.0.15.2554,0964,0944,09611111111.11111111.11110000.00000000
/22255.255.252.00.0.3.2551,0241,0221,02411111111.11111111.11111100.00000000
/23255.255.254.00.0.1.25551251051211111111.11111111.11111110.00000000
/24255.255.255.00.0.0.25525625425611111111.11111111.11111111.00000000
/25255.255.255.1280.0.0.12712812612811111111.11111111.11111111.10000000
/26255.255.255.1920.0.0.6364626411111111.11111111.11111111.11000000
/27255.255.255.2240.0.0.3132303211111111.11111111.11111111.11100000
/28255.255.255.2400.0.0.1516141611111111.11111111.11111111.11110000
/29255.255.255.2480.0.0.786811111111.11111111.11111111.11111000
/30255.255.255.2520.0.0.342411111111.11111111.11111111.11111100
/31255.255.255.2540.0.0.122 (RFC 3021)211111111.11111111.11111111.11111110
/32255.255.255.2550.0.0.011 (host route)111111111.11111111.11111111.11111111

Per-prefix pages

Each of these prefixes has its own page with the mask, host range, worked example and the subnets it contains.

Also useful: subnet calculator, VLSM planner, CIDR notation explained, subnetting guide.

IP to Binary Converter · Binary to IP Converter · IP to Hex Converter · Hex to IP Converter · IP to Decimal Converter ·

Frequently asked questions

What is a CIDR table used for?

It is the lookup you reach for while configuring. Given a prefix length you need the mask to type into an interface, the wildcard to put in an ACL, and the address count to sanity-check the allocation. Having all 33 prefixes in one place removes the arithmetic from the configuration step.

What is the difference between total addresses and usable hosts?

Total addresses is 2^(32 − prefix) and includes the network and broadcast address. Usable hosts subtracts those two, so a /24 has 256 total addresses and 254 usable hosts. The exceptions are /31, which RFC 3021 defines as a two-address point-to-point link with no reserved addresses, and /32, which is a single host route.

What is block size?

Block size is the number of addresses in the subnet, which is the same number as the total address count. It matters because it tells you the spacing between consecutive subnets: /27 blocks start every 32 addresses, so within a /24 they begin at .0, .32, .64, .96, .128, .160, .192 and .224. A subnet that does not start on a block-size boundary overlaps its neighbours.

Why do some prefixes have no description?

Prefixes between the common sizes are perfectly valid but rarely used in isolation. A /13 or a /19 appears mostly inside aggregate routing tables rather than on an interface. The table still lists their mask, wildcard and counts so the lookup is complete.

How many /24 subnets are in a /16?

256. The difference in prefix length is 8 bits, and 2^8 = 256. The same rule generalises: a /20 contains 2^(24−20) = 16 /24s, and a /8 contains 2^(24−8) = 65,536 /24s.

Which prefix should I use for a point-to-point link?

A /31 under RFC 3021 gives you two usable addresses with no waste, which is the modern default on router-to-router links. A /30 is the older convention and gives two usable addresses out of four, wasting two. Use /31 unless a platform does not support it.

What is the smallest usable subnet?

A /30 gives two usable hosts, a /31 gives two addresses on a point-to-point link, and a /32 is a single host. Anything longer than /32 is not a valid IPv4 prefix.