Skip to content
SmartDailyCalculator

Subnet Calculator

Enter an IPv4 address and prefix length to see the containing network block and host conventions.

Network address

192.168.1.0/24

Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Broadcast address
192.168.1.255
Address range
192.168.1.1 – 192.168.1.254
Addresses in block
256
Assignable host addresses
254

For prefixes /0 through /30, the conventional network and broadcast addresses are excluded from the assignable-host count.

How to use the Subnet Calculator

  1. Enter an IPv4 address in dotted-decimal notation.
  2. Enter a prefix length from 0 to 32.
  3. Read the network, broadcast, address count, and assignable-host conventions.

IPv4 prefix mask and network address

N=A AND M
B=N OR W
H=232−p

Where:

A
= 32-bit IPv4 address
M
= mask with p leading one bits
W
= wildcard mask, the bitwise inverse of M
p
= CIDR prefix length from 0 through 32
H
= number of addresses in the block
Show as plain text

Network = IPv4 address AND subnet mask Broadcast = network OR wildcard mask Block size = 2^(32 − prefix)

The prefix specifies how many leading bits identify the network. The remaining bits form the host portion of the address block.

Conventional IPv4 subnets through /30 reserve network and broadcast addresses. RFC 3021 defines special /31 use on point-to-point links; /32 identifies one address.

Assumptions and limitations

  • This tool handles IPv4 only; it does not calculate IPv6, routing policy, access control, or network security.
  • The prefix must be an integer from 0 through 32.
  • The host count follows conventional IPv4 /0–/30 rules, the RFC 3021 /31 point-to-point convention, and one address for /32.
  • Private/public status and special-purpose address allocations are not classified.

Example: Address 192.168.1.34 with prefix /24

  1. A /24 mask is 255.255.255.0.
  2. Applying the mask gives network 192.168.1.0; the block ends at broadcast 192.168.1.255.
  3. The block has 256 addresses and 254 conventionally assignable host addresses.

When to use the Subnet Calculator

  • Finding the network block containing an IPv4 address.
  • Checking prefix, subnet mask, and address range.
  • Understanding `/31` point-to-point and `/32` host-route cases described in the cited RFCs.

Subnet Calculator FAQs

What does /24 mean?

A /24 prefix means the first 24 bits identify the network and the remaining 8 bits form the address block's host portion.

How does a /31 subnet work?

RFC 3021 permits both addresses in a /31 block to be used on point-to-point links, rather than reserving a network and broadcast address.

Does this calculator support IPv6?

No. It accepts dotted-decimal IPv4 addresses and CIDR prefix lengths only.

References

How this calculator was built and tested is explained in our methodology. Spotted a problem? Let us know.