DEV

IP Subnet Calculator

Enter an IPv4 address with a prefix length or subnet mask to see the network and broadcast addresses, usable host range, host count and wildcard mask.

BINARY

        

How it works

An IPv4 address is a 32-bit number. The prefix length says how many of the leading bits name the network; the rest name hosts within it. The subnet mask is that same idea written out: ones for the network bits, zeros for the host bits. /24 and 255.255.255.0 mean exactly the same thing.

The network address is the IP address AND the mask. The broadcast address is the network address with every host bit set to 1. Usable hosts run from one above the network address to one below the broadcast, which is 2(32 − prefix) − 2 addresses.

Worked example

For 192.168.1.10/24 the mask is 255.255.255.0, the network is 192.168.1.0, the broadcast is 192.168.1.255, and usable hosts run from 192.168.1.1 to 192.168.1.254, 254 in total.

Planning a network? Pick the smallest prefix that fits your host count with some growth room: a /26 gives 62 hosts, a /25 gives 126 and a /24 gives 254. You can also paste a wildcard mask such as 0.0.0.255 and it will be read correctly. To convert addresses between bases, try the Number System Converter.

Frequently asked

What does the /24 in 192.168.1.0/24 mean?

It is the prefix length: the number of leading bits that identify the network. A /24 fixes the first 24 bits, leaving 8 bits for hosts, which gives 256 addresses and a mask of 255.255.255.0.

Why are there two fewer usable hosts than total addresses?

The first address in a subnet identifies the network itself and the last is the broadcast address, so neither can be assigned to a device. A /24 has 256 addresses and 254 usable hosts. The exceptions are /31, where both addresses are usable on a point-to-point link, and /32, a single host.

What is a wildcard mask?

It is the inverse of the subnet mask, with 1-bits where the address can vary. Cisco access lists and OSPF network statements use it. For 255.255.255.0 the wildcard is 0.0.0.255.

Does this support IPv6?

Not yet. This calculator handles IPv4 addresses only.