Skip to content
BestCalculators LogoBestCalculators
Free online calculators and converters

Electrical & Tech

IP Subnet Calculator: Mask, Network, Broadcast and Host Range

Work out the subnet mask, network and broadcast address, usable host range and host count from an IPv4 address and a CIDR prefix.

The address one octet per box, so 192.168.10.37 goes in as 192, 168, 10, 37.

/

The number after the slash — how many leading bits belong to the network. /24 is the familiar 255.255.255.0.

Usable host addresses

62

A /26 holds 64 addresses, two of which are the network and the broadcast. The /31 and /32 exceptions are handled rather than left to produce 0 and −1.

Total addresses in the block
64

Two to the power of the host bits. Every subnet size is a power of two, which is why 100 hosts costs you a block of 128.

Subnet mask, first octet
255

The mask reads 255.255.255.192 — the dotted form of the same /26, and the only form older equipment accepts.

Subnet mask, second octet
255
Subnet mask, third octet
255
Subnet mask, fourth octet
192
Network address, first octet
192

The network is 192.168.10.0/26. It is the address with every host bit set to zero, and it names the subnet rather than any machine on it.

Network address, second octet
168
Network address, third octet
10
Network address, fourth octet
0
Broadcast address, first octet
192

The broadcast is 192.168.10.63 — every host bit set to one. Assign it to a machine and traffic for the whole subnet arrives at it.

Broadcast address, second octet
168
Broadcast address, third octet
10
Broadcast address, fourth octet
63
First usable host, last octet
1

One past the network address, so 192.168.10.1 is the lowest address you may hand to a machine. On a /31 there is no network address to skip.

Last usable host, last octet
62

One below the broadcast. Routers conventionally take either this or the first, which is why neither should be in a DHCP pool.

Wildcard mask, last octet
63

The mask inverted, which is the form Cisco access lists and OSPF statements want. A /26 mask of 255.255.255.192 is a wildcard of 0.0.0.63.

Block size in the last octet
64

The step between one subnet and the next. Subnets start at multiples of this — 0, 64, and so on — which is the fastest way to do this in your head.

Subnets this splits a /24 into
4

How many blocks of this size fit in one 256-address range. A /26 gives four, at 0, 64, 128 and 192.

Is the address in private space
1

1 means RFC 1918 space — 10/8, 172.16/12 or 192.168/16 — which is not routable on the public internet and needs NAT to leave the building.

Host bits
6

What is left after the prefix. Every other figure here is a restatement of this one number.

How to use this calculator

  1. Enter the four parts of your IPv4 address into the First octet, Second octet, Third octet, and Fourth octet fields.
  2. Type the CIDR prefix value into the CIDR prefix box, representing the number of leading network bits.
  3. Review the calculated subnet mask, network address, and broadcast address instantly updated in the results panel.
  4. Check the usable host range and total host count for your configured subnet.

Understanding IP Subnets and CIDR

Every device connected to a network requires an IPv4 address, which consists of 32 bits divided into four octets of 8 bits each. An ip subnet calculator takes these numbers and splits them into two distinct parts: the network portion and the host portion. The boundary between these two parts is defined by the CIDR prefix, written as a slash followed by a number from 0 to 32. For example, a /24 prefix indicates that the first 24 bits identify the network, leaving the remaining 8 bits for individual devices. When you enter the First octet, Second octet, Third octet, and fourth octet into the input fields, the system performs a bitwise operation to isolate these segments.

Without a clear division of these bits, routers cannot efficiently forward data packets across local area networks and wide area networks. The subnet mask calculator function determines the dotted-decimal representation of this bit boundary, such as 255.255.255.0 for a /24 network. Every mask octet is calculated using the formula 256 - 2^(8 - bits of the prefix in that octet). This mathematical relationship ensures that network administrators can divide large physical networks into smaller, manageable broadcast domains without wasting valuable IP space.

How Network and Broadcast Addresses Are Derived

When calculating a subnet, two special addresses are always reserved and cannot be assigned to individual hosts: the network address and the broadcast address. The network address represents the entire subnet segment and is found by applying a bitwise AND operation between the IP address and the subnet mask. In practice, each network octet is computed using the formula floor(octet ÷ block) × block. For instance, if an address falls within a block size of 32 in the fourth octet, any host address from .32 to .63 resolves to .32 as its base network identifier.

Conversely, the broadcast address is the final address in the subnet range, used to transmit data to all devices on that specific segment simultaneously. It is derived by taking the network address and adding the total block size minus one, setting every host bit to binary one. If your network starts at 192.168.1.0 with a block size of 64, the broadcast address ends at 192.168.1.63. The usable host range always sits strictly between these two boundaries, starting one address above the network ID and ending one address below the broadcast ID.

Calculating Usable Hosts and Special Cases

The total number of IP addresses available in any subnet block is determined by the formula 2^(32 - prefix). However, the number of usable hosts is typically two fewer than this total because the network address and broadcast address are reserved for infrastructure duties. A standard /24 subnet provides 256 total addresses, yielding 254 usable host IP addresses for workstations, servers, and printers. As the CIDR prefix increases, the host bit count shrinks, reducing the pool of available addresses.

Modern networking standards also account for edge cases where the traditional rule of subtracting two hosts does not apply. Point-to-point links often utilize a /31 prefix, which yields exactly 2 usable addresses without reserving separate network and broadcast identifiers, optimizing scarce IPv4 allocations. Similarly, a /32 prefix defines a single host route with 1 usable address. Recognizing these exceptions prevents network engineers from miscalculating device capacity on serial interfaces or loopback configurations.

CIDR PrefixSubnet MaskTotal AddressesUsable Hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254

Private Address Spaces and Common Mistakes

Internet standards define specific blocks of IPv4 addresses for private internal usage, ensuring they are never routed across the public internet backbone. These ranges include 10.0.0.0 through 10.255.255.255, 172.16.0.0 through 172.31.255.255, and 192.168.0.0 through 192.168.255.255. When you input an address, the system checks these octet boundaries to flag whether the given IP resides in private space. Utilizing private ranges allows organizations to deploy thousands of internal devices behind a single network address translation gateway.

A frequent mistake among junior network administrators is assigning the calculated network address or broadcast address directly to a physical network interface card. Doing so causes erratic network behavior, IP address conflicts, and dropped packet frames because switches and routers treat those addresses as control traffic rather than host traffic. Always ensure that configured device IPs fall strictly inside the first usable host to last usable host range. When planning complex enterprise networks with overlapping subnets, consult a senior network architect or systems engineer to validate routing policies before implementation.

The formula

mask octet = 256 − 2^(8 − bits of the prefix in that octet)network octet = floor(octet ÷ block) × block, which is the bitwise ANDbroadcast = network + block − 1, every host bit setusable hosts = 2^(32 − prefix) − 2, except /31 (2) and /32 (1)

Frequently asked questions

What is the difference between a network address and a broadcast address?

The network address identifies the specific subnet segment itself and cannot be assigned to any host device. The broadcast address sits at the very end of the range and is used to send data packets simultaneously to every host on that subnet. Both addresses are permanently reserved by networking protocols.

Why do usable host counts subtract two from the total address block?

Every subnet must reserve two foundational IP addresses for network administration purposes. The first address in the block is the network identifier, and the last address is the broadcast identifier. Subtracting these two addresses leaves the remaining pool available for standard network hosts.

How does a /31 prefix differ from standard subnet calculations?

A /31 prefix is typically utilized for point-to-point links between routers where only two host addresses are required. Standard subnet rules would normally leave zero usable hosts after reserving the network and broadcast addresses. Special protocol standards allow /31 networks to provide exactly two usable host addresses without separate network and broadcast identifiers.

What makes an IPv4 address part of private space?

Private IP addresses are designated by international standards bodies for internal organizational use without registering with an internet registry. They are blocked from routing across the public internet, requiring network address translation for external connectivity. Common ranges include 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.

What happens if I accidentally assign a broadcast address to a server?

Assigning a broadcast address to a server interface causes severe network instability and packet delivery failures. Network switches and routers will treat traffic destined for that IP as broadcast traffic rather than unicast server traffic. This configuration error often leads to intermittent connectivity loss and ARP table corruption.

Sources

Last reviewed . Results are for general guidance and are not professional advice.