Technology / calculator

IP Subnet Calculator

Calculate IPv4 network and host ranges, masks and address counts, including /31 point-to-point links and /32 host routes.

Calculator

Calculator

Calculate an IPv4 subnet.

Enter dotted-decimal IPv4 and a prefix from 0 to 32. /31 uses RFC 3021 point-to-point addressing; /32 is one host route. Neither has a directed broadcast.

IPv4 network

Your result

Enter details to see the result.

Complete the inputs and calculate to see the main result and its supporting breakdown.

Example

Worked example

Example inputs

IPv4 address
192.168.1.10
CIDR prefix length
24

Calculation breakdown

A prefix p gives 2^(32−p) addresses. Network = floor(address/block size) × block size. Last address = network + size − 1.

Network address
192.168.1.0
Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Total addresses
256

Example result

Usable hosts

254

Excludes network and broadcast addresses.

How to interpret the result

Network and masks identify the aligned IPv4 block. Standard prefixes reserve network and broadcast addresses. The /31 count assumes a point-to-point link; /32 identifies one host. Address counts do not establish routability or assignability.

How to use this calculator

  1. Enter four decimal IPv4 octets, each from 0 to 255.
  2. Enter a CIDR prefix length from 0 to 32 without the slash.
  3. Calculate masks and host ranges; read the special point-to-point /31 or host-route /32 assumptions when applicable.

How it works

Formula

A prefix p gives 2^(32−p) addresses. Network = floor(address/block size) × block size. Last address = network + size − 1.

Are both addresses usable in a /31?

On an RFC 3021 point-to-point link, yes. A /32 identifies a single host; it also does not reserve a network or directed broadcast address.

What this calculator does

Inspect the network, mask and address range for an IPv4 prefix, including the special host counts of /31 and /32.

Inputs you will need

Required or selected inputs

  • IPv4 address
  • CIDR prefix length

What to check before using the result

A prefix partitions addresses; it does not discover which hosts are online or assign addresses. Ordinary subnets reserve network and broadcast addresses. A /31 point-to-point link uses both endpoints under RFC 3021; a /32 identifies one address. Check the device and routing context before applying those counts to a deployment.

Assumptions

  • IPv4 is treated as unsigned arithmetic. Prefixes 0–30 exclude network and broadcast; /31 uses RFC 3021 two-endpoint addressing and /32 is a single host route.

Limitations

  • IPv6, routing configuration, reserved-address policies and network reachability are not assessed. /31 and /32 have no directed broadcast; their final numeric address is identified separately.

Useful next steps

Once addressing is planned, estimate transfer capacity separately with Bandwidth Calculator.

References

RFC 3021: 31-bit IPv4 prefixes on point-to-point links — Both addresses in a /31 are endpoint addresses on a point-to-point link; no directed broadcast is reserved.

See how HandyChest handles units, validation, rounding, and testing, or Report a problem with this calculator.

Good to know

Frequently asked questions

Does a /32 have a broadcast address?

No directed broadcast is reserved for a /32 host route. The same IPv4 address is the first and last usable address and the block contains one address.

Keep going