CIDR Calculator

CIDR notation writes a network as an address and a prefix length, such as /26. This calculator finds the smallest block that holds the hosts you need, or converts a prefix to its mask.

Find
Results update as you type.

CIDR prefix

/26

mask 255.255.255.192

Addresses in the block
64
Usable hosts
62
Wildcard mask
0.0.0.63
Blocks of this size in a /24
4

About this calculator

It also shows how many blocks of that size fit in a /24.

How to use it

  1. Choose what to find.
  2. Enter the hosts needed, or the prefix.
  3. Read the result.

The formula

Prefix = 32 − ⌈log₂(hosts + 2)⌉
+ 2
network and broadcast addresses

Worked example

50 hosts

  1. 50 + 2 = 52 needs 6 host bits (64 addresses).
  2. Prefix /26, mask 255.255.255.192, 62 usable hosts; four fit in a /24.

What the result means

Leave room for growth when sizing subnets.

CIDR prefix reference, /8 to /32

Subnet mask, block size and usable hosts for each prefix
PrefixSubnet maskAddressesUsable hosts
/8255.0.0.01,67,77,2161,67,77,214
/12255.240.0.010,48,57610,48,574
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (point-to-point link)
/32255.255.255.25511 (single host)

Example: splitting one /24 for an office

Say an office has 192.168.5.0/24 and needs four networks: staff Wi-Fi for 100 devices, accounts for 50, CCTV for 20 and management for 10. The calculator gives /25 (126 usable), /26 (62), /27 (30) and /28 (14).

Allocate the largest block first so every block starts on a boundary that is a multiple of its size: staff 192.168.5.0/25, accounts 192.168.5.128/26, CCTV 192.168.5.192/27 and management 192.168.5.224/28. That uses 240 of the 256 addresses and leaves 192.168.5.240/28 spare.

Sizing mistakes to avoid

  • Forgetting the two reserved addresses. 62 hosts fit a /26 exactly, but 63 hosts need a /25.
  • Sizing with no headroom. A subnet that is full on day one has to be renumbered later, which is far more work than starting one size up.
  • Ignoring cloud reservations. AWS and Azure each reserve 5 addresses in every subnet, so a cloud /28 gives 11 usable addresses, not 14.

Assumptions

  • IPv4.

Limitations

  • Cloud providers reserve extra addresses in each subnet.

Frequently asked questions

What mask is /26?

255.255.255.192.

How many hosts in a /26?

62 usable.

What prefix for 100 hosts?

/25, with 126 usable.

What prefix do I need for 500 hosts?

/23. It has 512 addresses and 510 usable hosts, with mask 255.255.254.0.

How many /27 subnets fit in a /24?

8. Each /27 has 32 addresses, and 256 ÷ 32 = 8.

What does /32 mean?

A block of exactly one address. It is used for a single host, such as in a firewall rule or a route to one server.

Last reviewed on 12 October 2026. How we calculate and check. Found a mistake? Tell us.