Skip to main content

Subnet Calculator (IPv4)

Calculate network, broadcast, host range and host count from CIDR.

Reviewed for accuracy by the Math Ora X team Last updated

Result

About the Subnet Calculator (IPv4)

Calculates the key properties of an IPv4 subnet from an address and CIDR prefix: subnet mask, network address, broadcast address, usable host range and number of hosts.

How to use

Enter an IP address and CIDR prefix (e.g. 192.168.1.10/24), then click Calculate.

Worked example

192.168.1.10/24 → network 192.168.1.0, broadcast 192.168.1.255, 254 usable hosts.

How to use this calculator

  1. Enter an IPv4 network in CIDR form, such as 192.168.1.0/24.
  2. Read the calculated network address, broadcast address, host range, and usable host count.
  3. Use the host count to check whether the subnet is large enough for your devices.
  4. Compare nearby CIDR sizes if you need a smaller or larger subnet.

The formula explained

$$ \text{host count} = 2^{32 - \text{prefix}} - 2 $$

  • \(\text{prefix}\) = the CIDR prefix length, such as 24 in 192.168.1.0/24
  • \(\text{host count}\) = the number of usable host addresses in the subnet
  • \(\text{network address}\) = the first address in the subnet block
  • \(\text{broadcast address}\) = the last address in the subnet block
  • \(\text{host range}\) = the usable addresses between the network and broadcast addresses

Step by step method

  1. Start with the IP address and CIDR prefix.
  2. Determine how many bits are left for hosts by subtracting the prefix from 32.
  3. Use those host bits to find the size of the block and the usable address count.
  4. Identify the network address as the first address and the broadcast address as the last address.
  5. List the usable host range between those two endpoints.

Worked example

Here is a practical example using a small office subnet, 192.168.1.0/24.

  1. A /24 leaves 8 host bits, so the subnet contains \(2^8 = 256\) total addresses.
  2. Subtract the network and broadcast addresses, leaving \(256 - 2 = 254\) usable host addresses.
  3. For 192.168.1.0/24, the network address is 192.168.1.0 and the broadcast address is 192.168.1.255.
  4. The usable host range runs from 192.168.1.1 to 192.168.1.254.

Answer. 192.168.1.0/24 has 254 usable hosts, with host range 192.168.1.1 to 192.168.1.254.

Tips and common mistakes

  • Remember that the network and broadcast addresses are not usable by devices.
  • A smaller CIDR number means a larger subnet, while a larger CIDR number means a smaller subnet.
  • Check the prefix carefully, since one digit difference can change the host count a lot.
  • If you only need the usable hosts, use the host count rather than the total address count.

Frequently asked questions

What is CIDR?+

Classless Inter-Domain Routing notation: the /24 is the number of network bits.

Why 254 hosts in a /24?+

256 addresses minus the network and broadcast addresses.

More Tech Tools Tools

Explore related calculators in this category

You Might Also Like

Popular tools from other categories

Can't Find the Right Calculator?

Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.

Try AI Solver

Browse All Categories

Home Tech Tools Current Tool
Facebook Twitter WhatsApp