Skip to content

Free tools /

IPv4 subnet calculator

Enter an address with a CIDR prefix (10.0.0.0/22) or with a mask (10.0.0.0 255.255.252.0). It runs in your browser; nothing is sent anywhere.

Calculator

The prefix menu is used only when the field has no / or mask.

CIDR notation
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Total addresses
256
Usable hosts
254
Address type
Private (RFC 1918)
Mask in binary
11111111.11111111.11111111.00000000
Address in binary
11000000.10101000.00000001.00001010

Common prefix lengths

Mask and host counts for common prefix lengths
PrefixSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/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
/32255.255.255.25511

Questions

How many usable hosts does a subnet have?

Two to the power of the host bits, minus two: the network address and the broadcast address cannot be assigned to hosts. A /24 has 2^8 − 2 = 254 usable hosts, a /26 has 62 and a /30 has 2.

What is a /31 or a /32?

A /31 has two addresses and, under RFC 3021, both are usable: it is meant for point-to-point links between two routers. A /32 is a single address, used for a host route or a loopback.

What is a wildcard mask?

The inverse of the subnet mask: ones where the address may vary. 255.255.255.0 becomes 0.0.0.255. Access lists and some routing configurations use it instead of the mask.

Which addresses are private?

The RFC 1918 ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are not routed on the public internet. 100.64.0.0/10 is shared space used by carrier-grade NAT, and 169.254.0.0/16 is link-local.

How do I choose a subnet size?

Count the hosts you need today, add room to grow, and round up to the next power of two plus two. Do not make subnets much larger than needed: a large broadcast domain carries more noise and is harder to secure.