breakitdown

IPv4 subnet cheat sheet

Answer

Each step down in prefix length doubles the size of the network: a /24 has 256 addresses, a /23 512, a /22 1,024. Usable hosts are the total minus 2 (the network and broadcast addresses), except for /31 and /32.

Worked example: 10.0.0.0/8. Type any block to compare.

Try

10.0.0.0/8 is 16,777,216 addresses: 10.0.0.0 to 10.255.255.255. 16,777,214 usable for hosts (the first is the network address, the last is broadcast).

1000001010000000000000000000000000000
8 network bits 24 host bits
Network
10.0.0.0
First usable
10.0.0.1
Last usable
10.255.255.254
Broadcast
10.255.255.255
Addresses
16,777,216
Usable hosts
16,777,214
Netmask
255.0.0.0
Wildcard (ACL) mask
0.255.255.255
Historic class
A
Range type
Private network · not routed on the internet

Special-purpose range

Private network 10.0.0.0/8 RFC 1918
The largest of the three private IPv4 ranges: 16.7 million addresses for use inside homes and organisations. Not routed on the public internet.

IPv4 subnet table: /0 to /32

PrefixNetmaskWildcardAddressesUsable hosts/24s
/00.0.0.0255.255.255.2554,294,967,2964,294,967,29416777216
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,6468388608
/2192.0.0.063.255.255.2551,073,741,8241,073,741,8224194304
/3224.0.0.031.255.255.255536,870,912536,870,9102097152
/4240.0.0.015.255.255.255268,435,456268,435,4541048576
/5248.0.0.07.255.255.255134,217,728134,217,726524288
/6252.0.0.03.255.255.25567,108,86467,108,862262144
/7254.0.0.01.255.255.25533,554,43233,554,430131072
/8255.0.0.00.255.255.25516,777,21616,777,21465536
/9255.128.0.00.127.255.2558,388,6088,388,60632768
/10255.192.0.00.63.255.2554,194,3044,194,30216384
/11255.224.0.00.31.255.2552,097,1522,097,1508192
/12255.240.0.00.15.255.2551,048,5761,048,5744096
/13255.248.0.00.7.255.255524,288524,2862048
/14255.252.0.00.3.255.255262,144262,1421024
/15255.254.0.00.1.255.255131,072131,070512
/16255.255.0.00.0.255.25565,53665,534256
/17255.255.128.00.0.127.25532,76832,766128
/18255.255.192.00.0.63.25516,38416,38264
/19255.255.224.00.0.31.2558,1928,19032
/20255.255.240.00.0.15.2554,0964,09416
/21255.255.248.00.0.7.2552,0482,0468
/22255.255.252.00.0.3.2551,0241,0224
/23255.255.254.00.0.1.2555125102
/24255.255.255.00.0.0.2552562541/1
/25255.255.255.1280.0.0.1271281261/2
/26255.255.255.1920.0.0.6364621/4
/27255.255.255.2240.0.0.3132301/8
/28255.255.255.2400.0.0.1516141/16
/29255.255.255.2480.0.0.7861/32
/30255.255.255.2520.0.0.3421/64
/31255.255.255.2540.0.0.1221/128
/32255.255.255.2550.0.0.0111/256

Usable hosts subtract the network and broadcast addresses, except /31 (two usable, RFC 3021) and /32 (one). Cloud providers reserve more: AWS keeps 5 addresses in every subnet.

Split it into subnets

or

4 subnets.

SubnetUsable rangeHostsBroadcast
10.0.0.0/1010.0.0.1 – 10.63.255.2544,194,30210.63.255.255
10.64.0.0/1010.64.0.1 – 10.127.255.2544,194,30210.127.255.255
10.128.0.0/1010.128.0.1 – 10.191.255.2544,194,30210.191.255.255
10.192.0.0/1010.192.0.1 – 10.255.255.2544,194,30210.255.255.255

Is this IP in the range?

Range to CIDR blocks

What to know

The table lists every IPv4 prefix length with its dotted netmask, the number of addresses in one such network, and how many of them can be assigned to hosts. Prefixes that have their own page link to a full explanation with an example network.

To size a subnet, subtract any addresses your platform reserves from each row's usable count, then pick the smallest network that still covers your hosts with room to grow.

Gotchas

Related explainers

← CIDR calculator