Subnet Calculator

Calculate subnet masks, network ranges, and host counts.

Work out an IPv4 subnet from an address and a prefix (like 192.168.1.130/26) or a subnet mask (like 255.255.252.0). The calculator shows the network and broadcast addresses, the first and last usable hosts, how many usable hosts there are, the subnet and wildcard masks, the CIDR notation, the address in binary and hex, its old class and whether it's private, public or reserved. A cheat sheet lists every prefix from /16 to /32 with its mask and host count. Everything is calculated in your browser.

Examples: 10.0.0.0/8 · 192.168.1.130/26 · 172.16.4.1 255.255.252.0

Network
192.168.1.128/26
Usable hosts
62
Subnet mask
255.255.255.192
Network address192.168.1.128
Broadcast address192.168.1.191
First usable host192.168.1.129
Last usable host192.168.1.190
Usable hosts62
Total addresses64
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
CIDR notation192.168.1.128/26
Binary mask11111111.11111111.11111111.11000000
Binary address11000000.10101000.00000001.10000010
Hex address0xC0A80182
IP classC
Address typePrivate (RFC 1918)
Prefix cheat sheet (/16 to /32)
PrefixMaskAddressesUsable
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/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
/32255.255.255.25511

Common use cases

  • Plan the address ranges for a home or office network
  • Check which addresses are usable in a subnet before assigning them
  • Get the wildcard mask for a Cisco access list or OSPF statement
  • Study for networking exams such as CCNA and Network+

How to use

  1. Type an IP address with a prefix (10.0.0.5/24) or a mask (10.0.0.5 255.255.255.0).
  2. Read the network, broadcast and usable host range.
  3. Copy any value you need.
  4. Open the prefix cheat sheet to compare subnet sizes.

FAQ

Why are there two fewer usable hosts than addresses?

In a normal subnet the first address names the network and the last is the broadcast address, so neither can be given to a device. A /24 has 256 addresses and 254 usable hosts.

What about /31 and /32?

A /31 has two addresses, both usable on point-to-point links (RFC 3021). A /32 is a single host, often used for loopbacks and routes. The calculator shows these as special cases.

Which addresses are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private ranges for local networks (RFC 1918). The address type row tells you which range an address falls in.