IP subnet calculator

Network, mask and hosts, IPv4 or IPv6.

Subnet calculator

Split it

192.168.1.0/24

254 usable hosts

Private (RFC 1918)

Network address
Broadcast address
First usable host
Last usable host
Subnet mask
Wildcard mask
CIDR notation
Total addresses
Mask in binary
Address in binary

Runs in your browser. Nothing uploaded.

How to calculate a subnet

  1. Type an address with its prefix, like 10.20.30.40/22 or 2001:db8::/48, into IP address / prefix. For IPv4 you can also give the subnet mask after a space: 10.20.30.40 255.255.252.0.
  2. Read the network, the number of usable hosts and the address type at the top, then the full breakdown below.
  3. Click any value, such as the subnet mask or the first usable host, to copy it.
  4. To divide the network, pick Into equal subnets and a longer prefix, or By hosts needed and list how many hosts each subnet needs. The table shows every subnet with its host range.

Common subnet sizes

Prefix Subnet mask Addresses Usable hosts
/8 255.0.0.0 16,777,216 16,777,214
/16 255.255.0.0 65,536 65,534
/20 255.255.240.0 4,096 4,094
/22 255.255.252.0 1,024 1,022
/23 255.255.254.0 512 510
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2
/31 255.255.255.254 2 2
/32 255.255.255.255 1 1

Each bit you take off the prefix doubles the size of the subnet, so a /23 holds two /24s. To pick a size, find the smallest subnet whose usable hosts cover your devices plus room to grow.

Private and special address ranges

The calculator labels the address you enter with its type:

  • Private (RFC 1918) addresses are in 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They’re used inside home and office networks and never routed on the internet.
  • Loopback is 127.0.0.0/8. Traffic to these addresses never leaves the machine.
  • Link-local is 169.254.0.0/16. A device picks one of these when it can’t get an address from DHCP, which is a common sign of a network problem.
  • Shared address space, 100.64.0.0/10, is used by internet providers for carrier-grade NAT.
  • Multicast covers 224.0.0.0 to 239.255.255.255, for one-to-many traffic.
  • Public is everything else outside the reserved ranges, routed on the internet.