OhMyCalc

IPv4 / CIDR Subnet Calculator

Compute the network address, broadcast address, first and last host and subnet mask for any IPv4 address and CIDR prefix length.

How to Use the IPv4 / CIDR Subnet Calculator

  1. Enter the IPv4 address in dotted-decimal form.
  2. Enter the CIDR prefix length (0–32).
  3. Click Calculate to see network, broadcast and host range.

使用例

計算式

network = ip AND mask. broadcast = network OR ~mask. hosts span from network+1 to broadcast−1 for prefixes shorter than /31.

よくある質問

What happens with /31 and /32?
/31 is used for point-to-point links (RFC 3021) — both addresses are usable. /32 is a host route and has no usable range. The calculator returns the single address for both endpoints in these cases.
Are usable hosts the same as total hosts?
No — the network and broadcast addresses are reserved for /0 through /30, so usable hosts = 2^(32−prefix) − 2.
Does it handle IPv6?
No, this calculator is IPv4-only. IPv6 prefixes can be much larger and need 128-bit arithmetic.