Skip to content

Subnet Calculator

Enter an IPv4 address with a CIDR prefix such as 192.168.1.10/24, or with a subnet mask such as 255.255.255.0. The calculator returns the network details.

Result

Network address
192.168.1.0/24
Usable host range
192.168.1.1 to 192.168.1.254
Usable hosts
254
Broadcast address
192.168.1.255
Total addresses
256
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Address class
C
Address type
Private (RFC 1918)
Mask in binary
11111111.11111111.11111111.00000000
Address in binary
11000000.10101000.00000001.00001010

Formula

  • Network address = IP address AND subnet mask
  • Broadcast address = network address OR wildcard mask
  • Total addresses = 2^(32 − prefix)
  • Usable hosts = 2^(32 − prefix) − 2

How the Subnet Calculator works

An IPv4 address is 32 bits. The prefix length says how many of the leading bits identify the network. The remaining bits identify hosts within it. A /24 leaves 8 host bits, which is 256 addresses.

The first address in a subnet is the network address and the last is the broadcast address, so neither is assigned to a device. That is why a /24 has 254 usable hosts.

The subnet mask is the same information written as four numbers: a /24 is 255.255.255.0. The wildcard mask is its inverse and is used in access control lists.

Worked example

192.168.1.10/24 has the mask 255.255.255.0. The network is 192.168.1.0, the broadcast address is 192.168.1.255, and hosts run from 192.168.1.1 to 192.168.1.254, which is 254 usable addresses.

Frequently asked questions

How many hosts are in a /24, /25 and /26?

A /24 has 254 usable hosts, a /25 has 126 and a /26 has 62. Each extra prefix bit halves the block.

What is the subnet mask for /16?

255.255.0.0, which gives 65,534 usable hosts.

Which IP ranges are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved for private networks by RFC 1918.

Related calculators

All text, code and network calculators · All calculators

Related unit converters

Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.

☕ Like this tool?

Buy me a coffee to support development

☕ Support UnitGenie

If this tool has been helpful, consider buying me a coffee to support development and keep it free for everyone!