The address that names the block

A subnet is identified by its network address, the first address in the block, written together with the prefix, as in 10.20.0.0/16. Routing tables, firewall objects, cloud route entries and inventory sheets all expect that form. Hosts, on the other hand, are usually documented as 10.20.30.40, an address somewhere inside the block. This page converts one into the other. Enter any address and its prefix, and the page returns the network address. With the defaults, 10.20.30.40 and a prefix of 16, the result is 10.20.0.0. If you already know the host address and the mask from a configuration screen, this is the quickest route to the entry you need for a route or a rule. Because the result drops the host bits, it also works as a normalizing step before you compare two entries or look for duplicates in a list of networks.

How the AND operation works

The prefix defines a 32-bit mask whose leading n bits are ones. The calculator treats the address as an unsigned 32-bit integer, so the formula is network = address AND mask. Any bit ANDed with 1 stays the same, and any bit ANDed with 0 becomes 0. The network portion therefore survives and the host portion disappears. For 10.20.30.40/16, the mask is 255.255.0.0, so the first two octets pass through as 10.20 and the last two are cleared to 0.0. Doing it octet by octet works when the prefix is a multiple of eight. Otherwise the cut falls inside an octet and you need binary or the block-size method.

When the cut falls inside an octet

For 192.168.1.130/26, the mask is 255.255.255.192. In the last octet, 130 is 10000010 and 192 is 11000000, and the AND gives 10000000, which is 128. The network address is 192.168.1.128. A shortcut: block size is 256 minus the mask octet, here 64, and the network is the largest multiple of 64 not above 130, which is 128. For 172.16.37.200/20 the interesting octet is the third. The block size there is 16, the largest multiple of 16 not above 37 is 32, and the network is 172.16.32.0. For 203.0.113.77/29, the block size is 8, so the network is 203.0.113.72. The shortcut and the binary method give the same answer, so use whichever you can check faster, and let the page confirm the result.

Edge prefixes

The page accepts prefixes from 0 to 32. A prefix of 0 clears every bit and always returns 0.0.0.0, the network used for the default route, and a prefix of 32 keeps every bit and returns the address itself, since a /32 names a single host. A prefix of 8 applied to 10.255.255.255 returns 10.0.0.0. Some well-known blocks make good test cases. The carrier-grade NAT range 100.64.0.0/10 from RFC 6598 gives 100.64.0.0 for 100.64.5.9, and the link-local range 169.254.0.0/16 from RFC 3927 gives 169.254.0.0 for 169.254.12.7. The calculator does not treat these specially; the masking is the same.

Why the prefix matters as much as the address

The same address belongs to different networks under different prefixes. Take 192.168.1.130. With a /24 prefix the network is 192.168.1.0, and with a /26 it is 192.168.1.128. A host that believes it is on the /24 will try to deliver traffic for 192.168.1.10 directly, while a neighbor configured as /26 considers that address remote and sends it to the gateway. Many mysterious connectivity faults come from such mismatches. When you record a host address, record its prefix too, and run both ends of a failing connection through this page to see whether they place the address in the same block.

Using the result in routes and rules

Static routes, policy-based routing, access lists and cloud route tables list a destination as network and prefix. Writing a host address with a prefix, such as 10.20.30.40/16, is accepted by some systems and silently converted, but rejected or misinterpreted by others, so using the true network address is safer. It also helps in reviews, since two entries with the same network and prefix are visibly the same block. The network address is not usable as a host in a conventional subnet, so never assign it to an interface. Pair it with the broadcast address calculator to see the full span of the block. In a review, 10.20.30.40/16 and 10.20.0.0/16 describe the same block, but only the second is in the form that most tools expect for a route or rule.

Differences from the subnet calculator

The Subnet Calculator on this site returns the same network address along with the last address, the total count and the usable hosts. This page isolates the one result, for the common case where a record asks for the network and nothing else. The prefix range also differs slightly. This page accepts 0 through 32 and returns a boundary in every case, because masking is defined for all of them. It does not decide whether a host count makes sense for a /31 or /32. Use the longer tool when you need block size and host capacity, and this one for a quick lookup.

Private and public blocks

The network address says nothing about whether a block is public. RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks, and 198.51.100.0/24, 203.0.113.0/24 and 192.0.2.0/24 are set aside for documentation by RFC 5737. A result such as 172.16.32.0 sits inside the private /12, which runs from 172.16.0.0 to 172.31.255.255. Compare the result against these ranges yourself, because the calculator performs masking only and does not classify addresses or check whether a block is routable on the public internet. The default result, 10.20.0.0, sits inside the private 10.0.0.0/8 range, a fact you learn by comparing it with that list.

Input rules for the network address

The input must be a valid dotted-decimal IPv4 address and an integer prefix from 0 to 32. The output identifies the boundary defined by the address and prefix; it does not confirm that any address in the block is assigned, reachable or available for use. Prefixes in the standard notation come from the CIDR specification in RFC 4632, and the masking operation is the same for any equipment. If a network plan assigns blocks differently, such as by cloud provider rules that reserve additional addresses, follow the provider documentation for what can actually be used. Because this lookup handles only masking, keep the address plan itself in a separate record that shows owners and purposes.