Skip to content
OEWER Tools

Utilities

Subnet Calculator

Find the network, broadcast, mask, wildcard and usable host range of an IPv4 address and prefix, with the binary working shown.

  • Free
  • No sign-up
  • Runs in your browser

Share this tool:WhatsApp (opens in a new tab)Telegram (opens in a new tab)X (opens in a new tab)

For example 24, /24 or 255.255.255.0.

Network
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
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
Class
C
Range
Private (192.168.0.0/16)

How this is calculated

network = address AND mask

broadcast = network OR wildcard (wildcard is the mask with its bits flipped)

addresses = 2^(32 − prefix); usable hosts = addresses − 2

  1. A prefix of /24 means the first 24 bits are the network part, so the mask is 255.255.255.0.
  2. Address 11000000.10101000.00000001.00001010 (192.168.1.10)
  3. Mask 11111111.11111111.11111111.00000000 (255.255.255.0)
  4. AND gives the network 11000000.10101000.00000001.00000000 (192.168.1.0).
  5. Flip the mask for the wildcard 0.0.0.255, and OR it with the network to get the broadcast address 192.168.1.255.
  6. Addresses in the block = 2^8 = 256; usable hosts = 254 (256 − 2, since the network and broadcast addresses are not given to hosts).
  7. First host 192.168.1.1, last host 192.168.1.254.

IPv4 only. Class names are the old classful labels and are shown for reference; today networks are described by their prefix length.

How to use Subnet Calculator

How to use this calculator:

  • Enter an IPv4 address, such as 192.168.1.10.
  • Enter the prefix length (24, /24) or a subnet mask (255.255.255.0).
  • Read the network, mask, wildcard, broadcast, first and last usable host and the number of hosts.

Open How this is calculated under the result to see the formula and each step with your own numbers.

The formulas. Network = address AND mask. Broadcast = network OR wildcard. Addresses = 2^(32 − prefix); usable hosts = addresses − 2.

Examples

  • 192.168.1.10/24

    Network 192.168.1.0, broadcast 192.168.1.255, hosts 192.168.1.1 to 192.168.1.254: 254 usable hosts.

  • 10.20.30.200/27

    Network 10.20.30.192, broadcast 10.20.30.223, 30 usable hosts, mask 255.255.255.224.

Frequently asked questions

Does it support IPv6?

No. This calculator is for IPv4 only.

Why are two addresses not usable?

The first address of a subnet names the network and the last is the broadcast address, so neither is given to a host.

What about /31 and /32?

A /31 has two addresses and, as RFC 3021 allows, both can be used on a point-to-point link. A /32 is a single host address.

Is the address I type sent anywhere?

No. Everything is calculated in your browser.

Guides about Subnet Calculator