CruxDevCruxDev Tools Prompts
dev Utility • Zero-Server Privacy • 100% Client-Side

IP Subnet & CIDR Mask Calculator

Calculate network address, broadcast, usable host range, CIDR mask, and total IP capacity for any IPv4 block.

Overview

Calculate everything about an IPv4 subnet from an address and prefix length: network and broadcast addresses, usable host range, subnet mask, wildcard mask, host counts, address class, and a binary breakdown of IP and mask. Results update live as you type.

How It Works

Type an IPv4 address into the field; you may include a /prefix inline, such as 10.0.0.1/16, or pick the prefix from the dropdown listing /32 down to /0 with the mask and host count shown for each. Quick preset chips jump to common prefixes like /24 and /30. The result table shows network, first and last usable host, broadcast, mask, wildcard, and scope, and a binary panel displays the IP, mask, and network address as 32-bit patterns. A copy button exports the whole breakdown as text.

Step-by-Step Usage Guide

  1. Enter an IPv4 address, optionally with a /prefix suffix.
  2. Or pick the prefix from the dropdown and watch the mask shown beside it.
  3. Use a preset chip for common sizes like /24 or /30 point-to-point links.
  4. Copy the full breakdown for documentation or tickets.

Technical Specifications & Standards

The math is standard bit operations on the 32-bit address: the mask is the high prefix bits set, network is address AND mask, broadcast is network OR inverted mask, and the usable range is the two addresses inside those bounds. Two edge prefixes follow conventions rather than the naive formula. A /31 has two usable addresses per RFC 3021, which defined 31-bit prefixes for point-to-point links where network and broadcast addresses would be wasted, and a /32 is treated as a single host route. Scope detection recognizes RFC 1918 private ranges (10/8, 172.16/12, 192.168/16), loopback, and APIPA link-local 169.254/16. The address class card shows the legacy classful A through E classification; it is retained because exams and older documentation still use the vocabulary, even though routing stopped depending on classes decades ago. The calculator is IPv4 only: an IPv6 address fails validation with an error message rather than producing a wrong answer.

Targeted Use Cases

  • Sizing a subnet during network planning and confirming usable host counts.
  • Finding the network and broadcast address for a firewall or DHCP rule.
  • Reading the binary mask to understand exactly which bits split network from host.
  • Classifying an address as private, loopback, or link-local before debugging connectivity.

Notes & Gotchas

  • Use /31 for point-to-point links per RFC 3021 instead of burning a /30.
  • Read the wildcard mask row when writing ACL rules, since access lists take the inverse mask.
  • Check the scope card before assuming an address is routable; link-local and loopback are not.
  • Remember the tool is IPv4 only; plan v6 subnets elsewhere.

Frequently Asked Questions

Why does a /31 show two usable hosts?

RFC 3021 defines 31-bit prefixes for point-to-point links, where both addresses are usable as host addresses and there is no network or broadcast waste. The calculator implements that exception explicitly.

What is the wildcard mask for?

It is the inverted subnet mask, used by router access lists and some firewall rules. A /24 mask of 255.255.255.0 has wildcard 0.0.0.255, which matches any host inside the subnet.

Why does the tool show address classes if they are obsolete?

Classful addressing no longer drives routing, but the A to E vocabulary still appears in certifications and older documents, so the calculator reports it as informational context alongside the real prefix-based results.

Does it support IPv6?

No. The input validation accepts four octets of 0 to 255 and a prefix of 0 to 32, and anything else errors out rather than guessing. Use a dedicated IPv6 tool for v6 planning.