ShareYourGroupShareYourGroupIP and Internet

IPv4 subnet calculator

Type an address and choose a prefix. The network, the mask, the usable range and the broadcast address appear at once.

How to use it

  1. Type any IPv4 address from the network, for example 10.20.30.40. You can type the prefix with it: 10.20.30.40/19.
  2. Or choose the prefix from the list. Each entry shows the matching mask, so /24 and 255.255.255.0 are the same choice.
  3. Read the result. "Copy result" puts the main lines on your clipboard.

Nothing you type leaves your browser. The page does the arithmetic itself, so it also works offline once it has loaded.

What each line of the result means

LineMeaning
Network addressThe first address of the block. It names the network and is not given to a device
Subnet maskWhich leading bits are the network part, written as four numbers
Wildcard maskThe mask inverted. Some firewall and router rules are written with it
First and last usable addressThe range you can give to devices
Broadcast addressThe last address of the block. Data sent to it reaches every device on the network
Addresses in the block2 to the power (32 minus the prefix)
Usable for devicesThe block less the network and broadcast addresses
Kind of addressPrivate, public, loopback and so on, from the reserved ranges
Old classClass A, B or C under the scheme used before 1993. Shown for exam questions; it does not affect the result

A worked example

Take 192.168.1.77/26. A /26 leaves 32 − 26 = 6 bits for devices, so each block has 2^6 = 64 addresses. The blocks in the last number start at 0, 64, 128 and 192. The address .77 lies between 64 and 127, so:

The calculator opens with this address; choose /26 to check it.

Special cases the calculator handles

Choosing a prefix for a number of devices

Find the smallest block whose usable count covers your devices, and leave room to grow: 14 devices fit in a /28, 30 in a /27, 62 in a /26, 126 in a /25, 254 in a /24, 510 in a /23. The CIDR table lists every size from /0 to /32. For the idea behind masks, read subnet masks and CIDR explained.

Can it calculate IPv6 subnets?

Not this tool. IPv6 networks are almost always a /64. To tidy or expand an IPv6 address, use the IPv6 tool on this site.

Why are two addresses fewer usable than the block size?

The first address names the network and the last is the broadcast address. Neither can be given to a device, except in /31 and /32 blocks.

What mask does my home network use?

Almost certainly 255.255.255.0, which is /24. Your device's network details show it beside the IP address.