Network Summary
{{ networkCIDR }}
{{ maskDotted }} mask {{ totalAddresses }} total {{ usableHosts }} usable {{ ipClass }} class {{ rfcLabel }}
Field Value Copy
{{ row.key }} {{ row.value }}
Index Address Type Copy
{{ h.index }} {{ h.address }} {{ h.kind }}
Which CIDR Network Broadcast Copy
{{ r.which }} {{ r.cidr }} {{ r.network }} {{ r.broadcast || '—' }}
No neighbors at this boundary.
Level CIDR Network Broadcast Usable Copy
{{ u.level }} {{ u.cidr }} {{ u.network }} {{ u.broadcast || '—' }} {{ u.usable }}
Increase supernet levels to aggregate upward.
Field Decimal Binary Copy
{{ row.key }} {{ row.dec }} {{ row.bin }}

                

Introduction:

Classless Inter‑Domain Routing (CIDR) describes how an Internet Protocol version 4 network is partitioned into routable blocks by a prefix length that controls aggregation and host capacity. Network engineers, developers, and students use a CIDR calculator online to visualize boundaries, mask semantics, and address roles without memorizing tables. The concept replaces rigid classful allocations with flexible prefixes, improving utilization and summarization across routers, firewalls, and monitoring systems.

This tool accepts dot‑decimal IP address text and a prefix length or mask, then computes the network address, wildcard, broadcast status, first and last hosts, and the total and usable address counts. It also identifies class labels and special‑purpose ranges, lists host samples, and derives adjacent networks and supernets. A binary view presents zero‑padded octets for instruction, while optional charts and exports support documentation, provisioning, and automation.

For example, entering 10.0.5.17 with a moderate prefix shows the base network, the contiguous usable span, and whether a broadcast address applies; you can then copy the key values into tickets or configurations. The output clarifies how many hosts fit and where the next aligned block begins. Always confirm ranges before deployment in production networks; overlapping or mis‑sized subnets can disrupt routing and services.

Technical Details:

1) Concept Overview

IPv4 addressing models each endpoint as four octets and uses a prefix length p to indicate how many leading bits define the network portion. Given an address and p, deterministic bitwise operations yield the network boundary, any broadcast, and the host range. The total capacity equals a power of two, and interpretation changes at p=31 and p=32 where broadcast is not used and all addresses are usable. Class labels and special‑purpose ranges provide human‑readable context but do not alter the arithmetic.

2) Core Equation or Process

  1. Derive the subnet mask M from prefix p (first p bits set, others zero).
  2. Compute network address N as a bitwise AND of the IP and M.
  3. Compute the wildcard W as the bitwise NOT of M.
  4. Compute broadcast B as N OR W when p≤30; for p=31 or p=32, no broadcast is used.
  5. Total addresses T are 2(32−p); usable hosts U follow the case logic below.
T=232p N=IPM , W=¬M , B=NW  for p30 U= { 1  if p=32 2  if p=31 T2  if p30 }

3) Interpretation & Thresholds

Threshold Band Meaning Broadcast Present? Usable Hosts
/32 Single‑address host route No 1
/31 Point‑to‑point link No 2
/30–/24 Small subnets for access/LAN Yes 2(32−p)−2
/23–/16 Aggregated campus or region Yes 2(32−p)−2
/15–/8 Large aggregates Yes 2(32−p)−2
/7–/0 Macro routing blocks Yes 2(32−p)−2

Use /31 for efficient point‑to‑point links and /32 for host routes; all broader prefixes include a broadcast concept and reserve the first and last addresses.

4) Variables & Parameters

Parameter Meaning Unit/Datatype Typical Range Notes
IP address IPv4 endpoint in dot‑decimal Text a.b.c.d (0–255 each) Accepts “IPv4/prefix” or “IP mask”.
Prefix length Number of network bits Integer 0–32 Validated and applied from input when provided.
Host index 0‑based offset into usable hosts Integer 0–(usable−1) Special cases for /31 and /32.
Show first N hosts Limit sample listing “all” or integer 1–2048 or all Invalid values default to 32; capped at 2048.
Supernet levels Aggregate upward by levels Integer 0–8 Displays level, CIDR, and usable count.

5) Worked Example

Given IP 192.168.1.10 with p=24:

M=255.255.255.0 N=192.168.1.0 W=0.0.0.255,B=192.168.1.255 T=23224=256,U=254 First host=192.168.1.1,Last host=192.168.1.254

6) Assumptions & Limitations

  • IPv4 only; IPv6 is not parsed or computed.
  • Only contiguous subnet masks are accepted when provided as dotted masks.
  • Heads‑up /31 and /32 do not use broadcast and treat all addresses as hosts.
  • Host listings are capped for performance; CSV/JSON expose full context as needed.
  • Special ranges are annotated for awareness; arithmetic remains unchanged.
  • Capacity chart rendering is optional and may not load in minimal environments.

7) Edge Cases & Error Sources

  • Non‑integer or out‑of‑range octets (not 0–255) cause input rejection.
  • Invalid prefixes outside 0–32 are rejected, as are malformed CIDR strings.
  • Non‑contiguous masks cannot be converted to prefixes and are treated as invalid.
  • Neighbors may be missing at the address space edges (0.0.0.0/0 upper/lower bounds).

8) Scientific/Standards Backing

  • RFC 4632 — Classless Inter‑Domain Routing (CIDR) addressing and aggregation.
  • RFC 3021 — Using 31‑bit prefixes on IPv4 point‑to‑point links.
  • RFC 1918 — Address allocation for private internets.
  • RFC 6890 — Special‑Purpose Address Registries (IANA IPv4 special‑use blocks).

9) Privacy & Compliance

All calculations execute in your browser; this tool makes no network requests, and copies/exports are generated locally.

Step‑by‑Step Guide:

Follow these steps to calculate subnet boundaries, sample hosts, and neighbors quickly.

  1. Enter an IPv4 address in dot‑decimal under IP address. You may also append a prefix or provide a dotted mask.
  2. Pick a Prefix length; the list shows the mask alongside each prefix.
  3. Optionally set Host index to retrieve a specific usable address (0‑based). /31 and /32 behave specially.
  4. Choose Show first N hosts to limit the host table; use “All” for the entire usable span (capped).
  5. Increase Supernet levels to display aggregated parent networks.
  6. Copy or download CSV/JSON for documentation or automation.

Example: 172.16.4.5/20 ⇒ network 172.16.0.0, broadcast 172.16.15.255, usable 4094 hosts; previous block 172.15.240.0/20, next block 172.16.16.0/20.

You now have accurate boundaries, capacity, and context to plan addressing or verify configurations.

FAQ:

What input formats are supported?

Enter IPv4 as a.b.c.d, optionally with “/prefix”, or as “IP mask” using a contiguous dotted mask. The prefix is validated and the mask is converted to a prefix when contiguous.

How are /31 and /32 handled?

/31 yields two usable host addresses without broadcast; /32 represents a single‑address route. The UI labels first/last hosts accordingly and omits broadcast where not applicable.

What does the “Class” field indicate?

A class label (A–E) based on the first octet provides legacy context; it does not affect CIDR math or capacity.

Is my data stored or sent anywhere?

No. All parsing and calculations occur locally, and copies/exports are generated client‑side; the tool does not perform network requests.

Can I use it offline?

Yes, once the page is loaded. Computation is self‑contained; if optional UI or charting assets are unavailable, results still compute and display without the capacity chart.

How do I list or export hosts?

Use “Show first N hosts” to limit or choose “All” to enumerate the usable span (capped), then copy or download CSV; JSON includes inputs, summary, neighbors, supernets, and host samples.

What does “RFC range” mean?

It flags special‑purpose allocations such as RFC1918 private space, RFC6598 shared space, loopback, link‑local, test networks, multicast, and reserved ranges.

How do I validate a CIDR?

Confirm the address is four octets (0–255), ensure the prefix is an integer 0–32, or if supplying a mask, ensure it is contiguous so it converts cleanly to a prefix.

Troubleshooting:

  • “Invalid IPv4 address.” Ensure four octets, each 0–255, with dots only.
  • “Invalid CIDR prefix.” Use an integer between 0 and 32.
  • Mask accepted but not applied. Use a contiguous mask; non‑contiguous masks are rejected.
  • Host index shows blank. Check the tooltip for the valid range and /31 or /32 behavior.
  • No neighbors shown. You may be at the lower or upper boundary for the chosen prefix.

Advanced Tips:

  • Tip Enter “IP mask” to auto‑derive the prefix from a dotted mask.
  • Tip Use a 0‑based host index to fetch a specific address within the usable range.
  • Tip Increase supernet levels to see parent CIDRs for summarization tasks.
  • Tip Check the binary view to teach or verify bit boundaries across octets.
  • Tip Use CSV for quick documentation and JSON to integrate results into scripts or pipelines.

Glossary:

CIDR
Classless Inter‑Domain Routing; prefix‑based IPv4 allocation.
Prefix length (p)
Count of leading network bits in an address.
Subnet mask (M)
Bitmask with the first p bits set to one.
Wildcard mask (W)
Bitwise NOT of the subnet mask.
Network address (N)
Base address of the subnet.
Broadcast address (B)
Last address in subnets with p≤30.
Usable hosts (U)
Assignable addresses within the subnet.
Supernet
Aggregation formed by decreasing the prefix length.
RFC range
Special‑purpose block noted by standards.