random thoughts in the vacuum

OFFLINE · v0.1.6

ipcalc
INPUT
OUTPUT
Examples

IPv4

IPv6

IPv6 uses multicast instead of broadcast.

How to use?

Inspect IPv4 and IPv6 networks, or choose an IPv4 planning operation. Calculations run in your browser. Untouched modes open with a working example; switching back restores that mode’s inputs, including your edits. Expand Examples and use Load operation example to reset the current mode to its sample data. Results update as you type; Copy result copies the selected text or JSON format. Valid inputs are reflected in the page URL for sharing. The Result field adjusts its height to show all output lines. All data fields and mode-specific options are grouped inside INPUT; choose the calculation using the separate OPERATION selector below it. In Explain Network mode, Examples also lists common networks to load into the input. Hover over the input area for a hint about the selected mode’s accepted input. Explain’s address-type labels describe the entered address, including common special-use ranges; they do not classify every address in a broader network.

IPv6 examples include loopback, unique-local (private) address space, link-local, and multicast groups. IPv6 has no broadcast addresses; the all-nodes multicast group ff02::1 reaches IPv6 nodes on the local link. fc00::/7 is the unique-local range; fd00::/8 is its locally assigned half. For a real private network, generate a unique /48 within fd00::/8 as described in RFC 4193.

Input and planning

  • Explain Network: IPv4 CIDR (192.168.0.100/24), dotted netmask (192.168.0.1/255.255.128.0), or IPv6 (2001:db8::1/64). A space may replace the slash. The planning operations below accept IPv4 only and normalize host bits.
  • Allocate Subnets: enter one Name: count request per line; add or remove lines using the buttons or edit them directly. Largest blocks are placed first, with ties kept in input order. Choose usable hosts or total addresses.
  • Split CIDR: choose a target prefix or an exact power-of-two subnet count.
  • Range to CIDR: enter inclusive start and end addresses. Aggregation, subtraction and free-space results contain the smallest exact set of CIDRs.
  • Compare Networks: compare a network or inclusive start - end range with one or more networks/ranges, including pairwise comparisons between list entries. CIDRs can be identical, contained, disjoint or adjacent; arbitrary ranges can also overlap partially. Membership finds all matches, most specific first.
  • Find Free Space: subtract allocated networks from a pool; optionally enter a usable-host requirement to find the first fitting subnet. Allocations and exclusions must be entirely inside the pool.
  • Resize Network: a broader prefix returns the containing network and reports added addresses; a narrower prefix partitions the entire original network.
  • Convert Address / Mask: select the input representation. Binary accepts 32 bits with optional dots between octets; hexadecimal accepts eight digits with optional 0x. Masks and wildcard masks must be contiguous.

/0 includes 4,294,967,296 addresses. /31 has two usable point-to-point addresses and /32 one host; neither has a directed broadcast. Larger IPv4 subnets reserve the first and last addresses, so usable hosts equal total addresses minus two. Host-count planning uses these /31 and /32 conventions too. IPv6 counts include all addresses; IPv6 has no broadcast. These are mathematical capacities, not a promise that every address is assignable under local or special-purpose policies.

Lists accept at most 256 entries (64 for pairwise comparisons); generated subnet lists stop at 4,096 blocks. Narrow the input if a split would exceed that limit.

Legacy address classes

Classful addressing predates CIDR. Historical class A addresses have a first octet of 0–127 and a default /8 mask (0/8 and 127/8 have special uses). Class B uses 128–191 with /16; class C uses 192–223 with /24. Class D (224–239) is multicast; class E (240–255) is reserved, with the limited-broadcast exception below. The prefix you enter controls this calculator, regardless of the historical class.

Common special-use IPv4 networks

Network Purpose
0.0.0.0/32 Unspecified address, “this host” before configuration
0.0.0.0/0 Default route covering all IPv4 addresses; distinct from the unspecified address
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 Private networks
100.64.0.0/10 Shared address space, often carrier-grade NAT
127.0.0.0/8 Loopback; localhost commonly resolves to 127.0.0.1
169.254.0.0/16 Link-local autoconfiguration (Zeroconf / APIPA), not routed beyond the link
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 Documentation examples
198.18.0.0/15 Benchmark testing
224.0.0.0/4 Multicast
240.0.0.0/4 Reserved, except the limited broadcast address
255.255.255.255/32 Limited broadcast on the local link

A directed broadcast is the last address of an IPv4 subnet with prefix /0–/30; routers commonly disable forwarding of directed broadcasts. See the IANA special-purpose registry for the authoritative list and reachability exceptions.

Install the local CLI

These commands install the distribution’s ipcalc utility. Different projects share that name, so flags and features vary; check ipcalc --help locally.

  • Debian / Ubuntu: sudo apt update then sudo apt install ipcalc (Debian package).
  • Fedora: sudo dnf install ipcalc (Fedora package).
  • macOS with Homebrew: brew install ipcalc (Homebrew formula).
  • Windows with WSL: in administrator PowerShell run wsl --install -d Debian, restart if requested and complete Debian’s first-run setup. In Debian run sudo apt update then sudo apt install ipcalc. Invoke it there as ipcalc 192.168.0.1/24, or from PowerShell as wsl -d Debian -- ipcalc 192.168.0.1/24 (Microsoft WSL setup).

Example after installation: ipcalc 192.168.0.100/24.

Standards and references

Internet IPv4 map

Historical IPv4 usage map from the Carna botnet census

Image source: Carna botnet.

Back to tools