Subnet Calculator

100% private — runs on your device, never uploaded. Works offline once loaded.

Enter an IPv4 address and a CIDR prefix (like 192.168.1.0/24) to instantly get the network and broadcast addresses, subnet mask, wildcard mask, usable host range and host counts. Everything runs in your browser.

What a subnet calculator works out

A subnet calculator turns an IPv4 address and a CIDR prefix into every derived value you need to plan or troubleshoot a network. From 192.168.1.0/24 it computes the network address that identifies the block, the broadcast address at the top of it, the subnet mask and its inverse wildcard mask, the first and last usable host addresses, and how many hosts the block can hold.

Getting these by hand means converting to binary, applying an AND with the mask, and counting bits — easy to slip up on. The calculator does the bitwise arithmetic for you and shows the results the moment you change the address or prefix.

How the numbers are derived

The prefix length is the count of leading 1-bits in the mask. A /24 gives a mask of 255.255.255.0; the remaining 8 host bits mean 2^8 = 256 total addresses. The network address is the input AND the mask, and the broadcast is the network OR the wildcard (the bitwise inverse of the mask).

For ordinary blocks the first usable host is the network address plus one and the last is the broadcast minus one, which is why usable hosts equal total addresses minus two — one reserved for the network identifier and one for broadcast.

  • Network address = IP AND netmask.
  • Broadcast address = network OR wildcard mask.
  • Total addresses = 2 ^ (32 − prefix).
  • Usable hosts = total − 2 (for prefixes up to /30).

The /31 and /32 special cases

The minus-two rule breaks down at the very smallest blocks, and this tool handles that correctly. A /32 describes a single address — one host, no separate network or broadcast — which is common for loopbacks, host routes and firewall rules.

A /31, defined by RFC 3021, is used for point-to-point links between two routers. It has just two addresses and, by design, both are usable: there is no wasted network or broadcast address. The calculator reports two usable hosts for a /31 and one for a /32 instead of the misleading zero the naive formula would give.

Whether you are carving a large block into departmental subnets, sizing a VLAN, or checking that two interfaces sit in the same network, seeing the full picture at once makes the plan much easier to verify.

Frequently asked questions

What is the difference between the netmask and wildcard mask?

The netmask marks network bits as 1s (255.255.255.0). The wildcard mask is its bitwise inverse (0.0.0.255) and is the form used in access-control lists on many routers.

Why are usable hosts two fewer than total addresses?

For prefixes up to /30, the first address identifies the network and the last is the broadcast, so neither can be assigned to a host. Both are excluded from the usable count.

How many hosts does a /24 hold?

A /24 has 256 total addresses and 254 usable hosts, with the range running from .1 to .254 and .0 and .255 reserved.

Can I enter any host address, not just the network one?

Yes. Enter any address in the block, such as 192.168.1.37/24, and the calculator finds the correct network and broadcast for that subnet.

What does /0 mean?

A /0 prefix covers the entire IPv4 space — every address from 0.0.0.0 to 255.255.255.255 — and is typically seen as a default route rather than a real subnet.

Does this cover IPv6?

No. This calculator is for IPv4 addresses and CIDR prefixes from /0 to /32. IPv6 uses a much larger 128-bit address space with different conventions.

Advertisement