Checking a containing IPv4 block from an address
An IPv4 address plus a prefix length points to a block, and the first address of that block is usually a different number. This guide shows how to find the block containing an address and what its boundary means.
An address with a prefix names a block
Written as 192.0.2.130/26, an address and a prefix length together describe a group of consecutive addresses. The prefix says how many leading bits are fixed. Here that is 26 of 32, leaving 6 bits free, so the block holds 2^6 = 64 addresses. The entered address is only one member. The block itself begins at the lowest address that shares those 26 leading bits. This is why two people can type different host addresses with the same prefix and still be describing one block, and why the calculator reports a network address that differs from what was typed. The difference is not an error. It is the lowest address of the block, and every member of the block shares it. When the entered address already is the lowest one, as with 192.0.2.128/26, the network address and the entered address coincide, which is the form a routing entry normally uses. Any other member of the block, such as .129 or .190, gives the same network address and the same last address.
Finding the boundary with a bitwise AND
The calculator parses the four octets into a 32-bit number, builds a mask with ones in the first p bits, and ANDs the two. For prefix 26 the mask is 255.255.255.192. In the last octet, 130 is 10000010 in binary and 192 is 11000000. The AND keeps only the top two bits, giving 10000000, which is 128. The same operation on 190, binary 10111110, also gives 128. Both addresses therefore map to 192.0.2.128. The last address of the block is the network address plus 2^(32-p) - 1, so 128 + 63 = 191, and the block is 192.0.2.128 through 192.0.2.191.
Checking membership by range
A quick way to see which block an address falls in is to list the block starts for the prefix. With 64 addresses per block, the starts in the last octet are 0, 64, 128 and 192. The address ending in 130 lies between 128 and 191, and the address ending in 190 lies in the same span. An address ending in 77 would belong to the block starting at 64, which ends at 127. The subnet calculator confirms that for 192.0.2.77/26: network 192.0.2.64, last address 192.0.2.127, 64 addresses. Counting block starts by hand works well for prefixes that cut inside the last octet.
Prefixes that cut elsewhere
The same logic applies when the boundary falls in an earlier octet. Consider 198.51.101.9 with prefix 22. A /22 holds 1,024 addresses, which spans four values of the third octet. The third-octet block starts are multiples of 4, so 101 falls in the block that starts at 100. The block runs from 198.51.100.0 to 198.51.103.255. The entered address has a third octet of 101 and a last octet of 9, and neither of those appears in the boundary. A longer prefix such as /28 gives 16 addresses per block, so 192.0.2.77/28 sits in the block 192.0.2.64 through 192.0.2.79.
The difference between an interface address and a block
Router and server configurations often store an address with its prefix, such as 192.0.2.130/26, to say both which host address an interface uses and which block it sits on. The host portion is meaningful there. When you instead need to name the block, as when writing a route or an allocation record, the network address is the correct form. The two views come from the same data, and the AND operation turns the first into the second. Mixing them up leads to entries like 192.0.2.130/26 in places that expect 192.0.2.128/26, and some tools reject the former.
Why documentation addresses are used here
The ranges 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for documentation and examples by RFC 5737, so using them avoids pointing at a real network. Prefix-based addressing in its current form, usually called CIDR, is described in RFC 4632. Nothing in this worksheet connects to a network, assigns an address or reads a device configuration. It only performs the arithmetic on the numbers you enter, so the same steps work on any addresses you wish to normalize, including private ones. The private ranges in RFC 1918 (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) follow the same masking rule, so 192.168.37.200 with prefix 24 normalizes to 192.168.37.0 in the same way.
What the block boundary does not tell you
The first address of a block is a calculation result. It does not prove that the address is assigned, reachable or suitable for a particular device. Under common conventions, the first and last addresses of an ordinary block are set aside as the network and broadcast addresses, but whether that applies depends on the network context and the prefix length. Treat the count of 64 addresses as the size of the block, not as a promise that 64 devices can be configured on it. Check the actual addressing plan or the owner of the network before using any result for configuration. The same caution covers the answer to the question of whether two addresses are neighbors: 192.0.2.130 and 192.0.2.190 share a block here, but under a prefix of 27 they would fall into different blocks, 192.0.2.128 and 192.0.2.160, because the longer prefix splits the original block into two halves of 32 addresses each. The block you find always depends on the prefix you enter, so confirm it first.
Reading the mask alongside the prefix
A prefix of 26 corresponds to the dotted mask 255.255.255.192, and the two spell the same thing. The first 26 mask bits are ones, so the first three octets are 255 and the last octet has its top two bits set, which is 128 + 64 = 192. The inverse of the mask, 0.0.0.63, marks the free bits, and adding it to the network address gives the last address, 192.0.2.128 + 63 = 192.0.2.191. Some device configurations ask for the mask and others for the prefix length, so converting between them is routine. Keeping both in view also catches a slip such as pairing 192.0.2.128 with a mask that belongs to a longer prefix.
A worked check you can repeat
To test your own understanding, pick an address and a prefix, then predict three things before using the calculator: the block size, the start and the last address. For 203.0.113.45 with prefix 27, the block size is 2^5 = 32, the block starts are multiples of 32 in the last octet, and 45 lies between 32 and 63. The block is 203.0.113.32 through 203.0.113.63. Check the prediction against the subnet calculator. If it differs, the usual causes are using the wrong prefix, counting block starts from 1 instead of 0, or reading the prefix as the number of free bits instead of fixed bits.
Reproduce the checks
First containing block
Open the Subnet Calculator and enter:
- IP address
192.0.2.130- Prefix length
26
Expected output:
Network
192.0.2.128Last address
192.0.2.191Total addresses
64The entered address is inside the block.
Second member
Open the Network Address Calculator and enter:
- IP address
192.0.2.190- Prefix length
26
Expected output:
Network
192.0.2.128A different member yields the same boundary.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08