Subnet Range Calculator: Network, Broadcast, First & Last Host

Subnet Range Calculator

Enter an IPv4 address and a CIDR prefix or subnet mask to get the complete subnet range at once: the network address, the broadcast address, the first and last usable host, the total and usable host counts, and the exact role of your IP. You can also locate a specific host by its offset within the block.

🌐Choose Prefix Input

🎯Real Network Presets

📝IP and Subnet Inputs

Any address inside the subnet works; the network is derived from it.

The prefix sets how many leading bits are the network portion.

Dotted decimal mask; the tool converts it to a prefix length.

Host number counted from the network address, so 1 is the first host.

Adds the binary network and mask to the breakdown panel.

Standard subtracts 2; /31 and /32 are handled as special cases.

Network Address 0.0.0.0 the subnet identifier
Broadcast Address 0.0.0.0 last address in block
Usable Host Range 0.0.0.0 first to last host
Usable Hosts 0 of 0 total addresses

🔢Range Formula Snapshot

ANDIP & mask = network
ORnet | wildcard = bcast
net+1first usable host
2^hh = 32 minus prefix

📋Example Networks and Their Ranges

CIDR BlockNetworkFirst HostLast HostBroadcast
192.168.1.0/24192.168.1.0192.168.1.1192.168.1.254192.168.1.255
192.168.0.0/25192.168.0.0192.168.0.1192.168.0.126192.168.0.127
172.16.5.0/26172.16.5.0172.16.5.1172.16.5.62172.16.5.63
10.0.8.0/2710.0.8.010.0.8.110.0.8.3010.0.8.31
10.1.1.0/2810.1.1.010.1.1.110.1.1.1410.1.1.15
203.0.113.8/29203.0.113.8203.0.113.9203.0.113.14203.0.113.15
198.51.100.0/30198.51.100.0198.51.100.1198.51.100.2198.51.100.3
10.255.0.0/3110.255.0.010.255.0.010.255.0.1n/a

📊Octet Boundary Block Sizes

PrefixLast Mask OctetBlock SizeSubnets per /24Usable Hosts
/2402561254
/251281282126
/2619264462
/2722432830
/28240161614
/292488326
/302524642

🧮Which Subnet Does an IP Fall In

PrefixMagic NumberMultiples in Last OctetExample IPIts Network
/251280, 128x.x.x.130x.x.x.128
/26640, 64, 128, 192x.x.x.100x.x.x.64
/27320, 32, 64, 96 ...x.x.x.70x.x.x.64
/28160, 16, 32, 48 ...x.x.x.45x.x.x.32
/2980, 8, 16, 24 ...x.x.x.29x.x.x.24
/3040, 4, 8, 12 ...x.x.x.14x.x.x.12

🗃Prefix Range Comparison Grid

PrefixBlock SizeWildcardNetwork (Base 0)BroadcastUsable Range
/2210240.0.3.255x.x.0.0x.x.3.255.0.1 to .3.254
/235120.0.1.255x.x.0.0x.x.1.255.0.1 to .1.254
/242560.0.0.255x.x.x.0x.x.x.255.1 to .254
/251280.0.0.127x.x.x.0x.x.x.127.1 to .126
/26640.0.0.63x.x.x.0x.x.x.63.1 to .62
/27320.0.0.31x.x.x.0x.x.x.31.1 to .30
/28160.0.0.15x.x.x.0x.x.x.15.1 to .14
/2980.0.0.7x.x.x.0x.x.x.7.1 to .6
/3040.0.0.3x.x.x.0x.x.x.3.1 to .2
/3120.0.0.1x.x.x.0noneboth .0 and .1

Formula Breakdown

IP to 32-bit integerCombine the octets: ip = o1 × 16777216 + o2 × 65536 + o3 × 256 + o4. For 192.168.1.45 that is 3232235821.
Mask from prefixThe mask sets the top prefix bits to 1: mask = (0xFFFFFFFF left-shifted by 32 minus prefix). A /24 gives 255.255.255.0.
Network = IP AND maskA bitwise AND clears the host bits. 192.168.1.45 AND /24 mask gives the network 192.168.1.0.
Wildcard = NOT maskThe wildcard is the inverse of the mask, marking the host bits. For /24 it is 0.0.0.255.
Broadcast = network OR wildcardA bitwise OR sets every host bit to 1. Network 192.168.1.0 OR 0.0.0.255 gives 192.168.1.255.
First and last hostFirst usable = network + 1 and last usable = broadcast − 1. For /24 that is .1 through .254.
Host countsTotal = 2 to the power of (32 − prefix); usable = total − 2 for /24 and larger blocks, with /31 and /32 handled separately.
Locate a hostHost number k sits at network + k, so offset 10 in 192.168.1.0/24 is the address 192.168.1.10.

💡Subnet Range Tips

Halving doubles the count: Every extra prefix bit halves the block and roughly halves usable hosts. A /24 holds 254 usable, a /25 holds 126, a /26 holds 62, and a /27 holds 30. Add one bit and you gain a subnet but lose half your address space, so size the prefix to the real device count plus a little growth room.
Point-to-point links: A /30 gives 4 addresses but only 2 usable, ideal for a router-to-router link where each end needs one IP. A /31 squeezes the same link into 2 addresses with both counted as usable under RFC 3021, saving space across many WAN links where the network and broadcast reservations would otherwise waste half the block.

The internet goes down, you plug in a new access point. You go look at the IP settings. No problems. The subnet mask appears correct and the IP address seem right. But still no traffic. This isn’t a hardware problem (usually). This is typicaly some form of arithmetic error acting like a configuration problem.

You configured the wrong address on the wrong side of a subnet boundary or you configured it for broadcast address. The device attempts to talk to every one at once, and it’s ignored by everybody else.

Why Your IP Settings Are Wrong

An IP address is a number with 32-bits split into two sections: a network part (high-order) and a host part (low-order). A subnet consist of a continuous set of addresses which have common values for their higher-order bits. The number of leading bits fixed by the subnet are called its prefix length and can be expressed using a slash: /24. All other bit are host bits. Each different sequence of host bits correspond to an IP address in the range.

The first address in the range is known as network address. It describes this particular group of addresses. The last address in the range is known as the broadcast address. It’s sent out to everyone in the range to ‘shout’ something at them all. In between there should be addresses assigned to physical interface.

Getting this right avoids a nasty surprise that you only notice when it’s too late on your office and home network. This is actualy performed using bitwise logic, which doesn’t use simple addition. A “logical AND” on your IP and subnet mask will clear out any host bits and leave just the network portion. That’s your network address.

To form what’s called a wildcard, you invert that subnet mask. You then perform a logical OR against the network address, setting all the host bit to one to find the top of the range, known as its broadcast address. The calculator above does all this binary arithmetic for you in an instant, without you having to convert the octets yourself. One pass, you see floor, ceiling, and usable space between.

The very first and very last aren’t used for most subnet anyway. They’re reserved for protocol overhead. Therefore, the first usable host is the network address +1. Likewise, the last usable host is the broadcast -1. A standard /24 network give us 256 total addresses and only 254 usable ones.

Down to a /30 subnet this reserve rule apply as well. That leaves us with four addresses and two usable host. It is perfect for point-to-point links between router. All you need is an IP on both ends of the wire.

Many gets tripped up on exceptions. RFC 3021 permits a /31 prefix to have two addresses and use them both as host addresses over a point-to-point link. There is no broadcast or network address. Just two endpoints and an exhaust of the whole block. This saves precious IPv4 space within large provider networks.

Even smaller is a /32 which is a single host route. These is often used for firewall rules that apply specifically to a single device or a loopback interface.

When designing something that will scale, getting this right does matter. The magic number approach is also how network engineers mentally locate a range. Take the block size as 256 minus the interesting octet of the mask. A /26 with an ending octet of 192 has a magic number of 64. The subnets will be on multiples of 64: zero, sixty-four, one hundred twenty-eight, and so on. What about an IP address that ends in one hundred? That’s part of the block that starts at sixty-four.

The tool’s reference tables spells out those multiples for each common prefix. This lets you check your mental math against exact values. It closes the gap between back-of-the-envelope estimation and ready-for-production.

Why deal with quietly expensive subnetting mistakes? A device on the broadcast address don’t route properly. When a DHCP pool overflows into another subnet, it create IP conflict problems that waste hours tracking down. Subnetting errors are quietly expensive.

Knowing the network address, the first host, the last host, and the broadcast address remove guesswork and computes these values in one step. Find any given host’s location within a range by knowing how far off it is. Verify your gateway is where you expect it to be.

Begin with a defined scenario. Change the octets to fit your plan. Scan through the entire range in seconds. It converts complex binary math into real network boundaries. Avoids wasted time while keeping traffic flowing as intended.

Subnet Range Calculator: Network, Broadcast, First & Last Host