🌐

Subnet Calculator

Work out the network, broadcast, mask, wildcard and host range for any IPv4 address and CIDR prefix, and split a subnet into equal parts.

Typing a slash in the address box, like 10.0.0.0/8, overrides the prefix field.

Opens your print window: choose "Save as PDF". The file is named "Subnet Calculator - MondayTool".
About this tool

Last updated:

Subnet calculator for IPv4 and CIDR

This subnet calculator takes an IPv4 address and a prefix length and shows the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total addresses and usable hosts. It also shows the address in binary with network and host bits colored differently, says whether it is private, loopback, link-local or public, and can split the subnet into equal smaller ones.

How to use it

  1. Type an IPv4 address in the first box, for example 192.168.1.10. You can also type it with the prefix, like 192.168.1.10/24, and the slash part overrides the prefix field.
  2. Set the prefix length from 0 to 32 if you did not type it in the address box.
  3. Read the results table, the usable host range and the binary view.
  4. To divide the subnet, open Split into equal subnets and choose a longer prefix. The tool lists each subnet with its network, usable range and broadcast address.

CIDR prefix cheat sheet

PrefixSubnet maskUsable hosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/20255.255.240.04,094
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

How it works

An IPv4 address is a 32-bit number. The prefix length is how many of its leading bits identify the network. The rest identify hosts. The tool uses these formulas:

  • Total addresses: 2^(32 - prefix)
  • Usable hosts: 2^(32 - prefix) - 2 (the network and broadcast addresses are not assigned to hosts)
  • Network address: address AND mask
  • Wildcard mask: NOT mask
  • Broadcast address: network OR wildcard

Two special cases follow RFC 3021: a /31 has 2 usable addresses (a point-to-point link) and a /32 is a single host.

Worked examples

  • 192.168.1.10/24: network 192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0, wildcard 0.0.0.255, hosts 192.168.1.1 to 192.168.1.254, 254 usable.
  • 172.16.5.9/20: network 172.16.0.0, broadcast 172.16.15.255, mask 255.255.240.0, 4,094 usable hosts.
  • 10.0.0.0/8: 16,777,216 addresses, 16,777,214 usable.
  • 192.168.1.0/24 split into /26 gives 4 subnets that start at 192.168.1.0, .64, .128 and .192, each with 62 usable hosts.

Assumptions and limits

  • IPv4 only. No IPv6. Nothing you type is sent anywhere.
  • The split tool makes equal-sized subnets. It does not plan variable-length (VLSM) layouts across mixed sizes.
  • The subnet list shows at most 256 rows and says so when more exist.
  • The address type note covers the private ranges (10/8, 172.16/12, 192.168/16), loopback, link-local, and calls everything else public.
  • Addresses with leading zeros, such as 010.1.1.1, are rejected because they are ambiguous.

Frequently asked questions

How many hosts are in a subnet?

Take 2 to the power of (32 minus the prefix length), then subtract 2 for the network and broadcast addresses. A /24 has 256 addresses and 254 usable hosts; a /26 has 64 addresses and 62 usable hosts.

What is a wildcard mask?

It is the subnet mask with every bit flipped. For 255.255.255.0 the wildcard mask is 0.0.0.255. The calculator shows it next to the subnet mask.

Why does a /31 show 2 usable hosts?

RFC 3021 allows /31 networks on point-to-point links, so both addresses can be used and there is no separate broadcast address. A /32 is one single address.

Do I have to enter the network address?

No. You can enter any address inside the subnet, such as 192.168.1.10/24, and the tool works out the network address for you.

More to explore

Related Network & API

Browse all tools from the same category.

Showing 1-2 of 8