Home · Everyday · Tech, Text & Media · IP Subnet Calculator

IP Subnet Calculator

Subnet arithmetic for an IPv4 address and prefix: network, broadcast, mask, usable range and host count.

Your figures

Example result — edit the figures to make it yours

254

Usable host addresses

Usable = 2^(32 − prefix) − 2: the all-zeros host part names the network and the all-ones host part is the broadcast address.

Network address192.168.1.0/24
Broadcast address192.168.1.255
Subnet mask255.255.255.0
First usable192.168.1.1
Last usable192.168.1.254
Total addresses256

What this calculator does

Subnet arithmetic for an IPv4 address and prefix: network, broadcast, mask, usable range and host count. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.

The formula and method

Usable hosts = 2^(32 − prefix) − 2 (network and broadcast reserved)

The subnet is computed from the address and prefix length; the network address zeroes the host bits.

Usable hosts exclude the network and broadcast addresses (except /31 and /32 point-to-point cases).

IPv4 addresses are 32-bit numbers, which is what the converter shows.

Worked example

With the example inputs this page opens with (prefix length (cidr) 24), the result is 254 — usable host addresses. Usable = 2^(32 − prefix) − 2: the all-zeros host part names the network and the all-ones host part is the broadcast address.

Quick reference

Quick reference — varying prefix length (cidr)
Prefix length (CIDR)Usable host addresses
121,048,574
19.28,190
24254
302
25126
2662

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How does the IP Subnet Calculator work?

Subnet arithmetic for an IPv4 address and prefix: network, broadcast, mask, usable range and host count. IP · Prefix length → Subnet details. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the IP Subnet Calculator need?

IP · Prefix length → Subnet details. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.

Is the IP Subnet Calculator free to use?

Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.