Skip to content

A CLEARER WAY TO WORK IT OUT

IPv4 Subnet Calculator

An IPv4 address identifies a point within a subnet, while the prefix tells you how large that subnet is. This calculator shows the network, mask and address range together so the relationship is easier to inspect.

An IPv4 address identifies a point within a subnet, while the prefix tells you how large that subnet is. This calculator shows the network, mask and address range together so the relationship is easier to inspect.

Your result will appear here.

Your calculation runs in this browser. After changing a value, select Calculate to update the answer.

Your inputs stay in this browser. Change a value, then calculate again to update the result.

How to use the ipv4 subnet calculator

An address such as 192.168.1.42 goes with a prefix such as /24. The network need not start at the address you enter: the prefix determines which bits belong to the network and which remain for hosts.

A network prefix separates the shared network part of an IPv4 address from the address space inside that block. Use the prefix from the actual network design rather than choosing it just to produce more hosts. The displayed range describes addresses in the calculated block, while usable-host conventions depend on the prefix and network type. This is a planning and checking tool; it does not change a router or assign any address.

What the result tells you

For 192.168.1.42/24, the network is 192.168.1.0 and the mask is 255.255.255.0. The usual host range is .1 through .254; the network and broadcast addresses have separate roles.

A calculation you can check

192.168.1.42/24 belongs to network 192.168.1.0 with netmask 255.255.255.0 and 254 usual host addresses, from .1 through .254.

Try it in the calculator ↑

Formula and calculation method

A prefix p reserves p high bits for the network. Block size = 2^(32−p). Network = floor(address/block size)×block size. Last address = network+block size−1.

Check the assumptions

A /31 point-to-point network and a /32 single address follow special conventions shown in the result. This tool calculates an address range; it does not inspect or change your network.

IPv4 only. /31 uses the RFC 3021 point-to-point interpretation with both addresses usable; /32 identifies one address. The calculator does not discover routes, test connectivity, allocate addresses or configure your network.

Frequently asked questions

Why are network and broadcast addresses usually excluded?

In a conventional subnet, those endpoints have special roles and are not assigned as ordinary host addresses. The usual host count subtracts them.

What is special about /31?

RFC 3021 permits both addresses on an IPv4 point-to-point /31 link. That exception differs from the ordinary network-and-broadcast convention; confirm support in the intended network.

Reference: Official source and method reference. The guide above describes how this QuickToolsy tool uses its stated assumptions.

Something looks wrong? Send the calculator name and a non-sensitive example so the issue can be checked.