Subnet Calculator

Enter an IP address and subnet mask or CIDR prefix to instantly find the network and broadcast address, usable host range and count, and IP class. Free subnet calculator.

How to Use

  1. Enter IP address

    Input an IPv4 address (e.g., 192.168.1.0).

  2. Enter subnet mask

    Provide a CIDR prefix (/24) or dotted-decimal mask (255.255.255.0).

  3. View results

    Click Calculate to see the network range, usable host count, wildcard mask, and more.

What Is a Subnet?

A subnet is a smaller logical division of a single larger IP network. A 32-bit IPv4 address is split into a network portion and a host portion; the boundary between them is set by the subnet mask, and expressing that mask as a number of bits gives you the CIDR prefix (such as /24).

There are three main reasons to subnet a network.

  • Address conservation: Carve up the address space to match the number of hosts you actually need, reducing wasted IPs.
  • Broadcast isolation: Separate networks to contain unnecessary broadcast traffic.
  • Security and management: Split networks by department or purpose to simplify access control and routing.

Just enter an IP and a CIDR, and this calculator shows the network address, broadcast address, usable host range, IP class, and whether the address is private all at once.

Calculation Formula

Every value is derived from 32-bit bitwise operations.

  • Subnet mask = 0xFFFFFFFF << (32 - CIDR)
  • Network address = IP AND subnet mask
  • Wildcard mask = NOT subnet mask
  • Broadcast = network address OR wildcard mask
  • Total hosts = 2^(32 - CIDR), Usable hosts = 2^(32 - CIDR) - 2

Example: 192.168.1.10/24 → mask 255.255.255.0, network 192.168.1.0, broadcast 192.168.1.255, usable hosts 192.168.1.1 to 192.168.1.254, giving 254 addresses (= 2^8 - 2). The -2 accounts for the network address and the broadcast address, which are reserved.

Frequently Asked Questions

What is a subnet mask?
A subnet mask is a 32-bit value that distinguishes the network portion of an IP address from the host portion. For example, 255.255.255.0 (/24) marks the top 24 bits as the network and the bottom 8 bits as the host. It is the criterion for deciding whether two devices belong to the same network.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation expresses a network range by appending a slash (/) and a prefix length after the IP address. 192.168.1.0/24 means the top 24 bits are the network and includes 256 addresses (254 usable hosts).
What are the private IP ranges?
RFC 1918 defines three private IP ranges. Class A: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255), Class B: 172.16.0.0/12 (172.16.0.0 to 172.31.255.255), Class C: 192.168.0.0/16 (192.168.0.0 to 192.168.255.255). These ranges are not routed directly on the internet, so you can use them freely on internal networks.
How is the number of usable hosts calculated?
The total number of hosts is 2^(32-CIDR), and the usable hosts are that value minus 2. For example, a /24 has 2^8 = 256 addresses, of which 254 are usable after excluding the network and broadcast addresses. A /30 has only 2 usable out of 2^2 = 4 addresses, which is why it is commonly used for point-to-point links connecting two routers.
Why can't the network and broadcast addresses be used as hosts?
The network address (all host bits 0) is the identifier for the subnet itself, and the broadcast address (all host bits 1) is a special address that sends to every device in the subnet at once. Both addresses are reserved and cannot be assigned to individual devices.
What is a wildcard mask and where is it used?
A wildcard mask is the bitwise inverse of the subnet mask; for a /24 it becomes 0.0.0.255. In the mask, 0 means 'must match' and 1 means 'ignore,' so it is mainly used to specify address ranges in Cisco ACLs and OSPF routing configurations.
How do you tell IP classes A, B, and C apart?
They are distinguished by the value of the first IPv4 octet. A is 1 to 126, B is 128 to 191, C is 192 to 223, D (multicast) is 224 to 239, and E (experimental) is 240 to 255. 127 is reserved for loopback (localhost). Today, however, CIDR-based variable-length subnetting is the standard rather than class distinctions.
2026 device specs

Related Calculators