IP Range Calculator

Turn any subnet into a clear address range. Validate masks, find hosts, and classify space. Download clean reports and share them with colleagues today

Calculator

Choose an input style for your task.
0–32 for IPv4.
Must be a contiguous mask.
Shows first/last N addresses (or all if small).
Reset

Example Data

Input Mode Expected Output (summary)
192.0.2.10 /24 CIDR / Prefix Network 192.0.2.0, Broadcast 192.0.2.255, Usable 254
203.0.113.55 + 255.255.255.0 IP + Subnet Mask Network 203.0.113.0, Broadcast 203.0.113.255, Usable 254
198.51.100.0 → 198.51.100.255 Start IP + End IP Total 256, Minimal CIDR 198.51.100.0/24

Examples use documentation address blocks.

Formulas Used

  • Integer form: convert dotted IPv4 to a 32-bit integer.
  • Mask from prefix: mask = 232 − 232−p (for prefix p).
  • Wildcard: wildcard = NOT(mask) within 32 bits.
  • Network: network = IP AND mask.
  • Broadcast: broadcast = network OR wildcard.
  • Counts: total = 232−p, usable ≈ total − 2 (except /31 and /32).
  • Range to CIDR: repeatedly take the largest aligned block that fits.

How to Use

  1. Select a mode that matches your input data.
  2. Enter an IPv4 address with either a prefix or mask, or provide a start and end address.
  3. Set a sample limit if you want quick visibility into the range.
  4. Press Submit to view results above the form.
  5. Use the CSV or PDF buttons to export the current report.

CIDR Inputs and Address Capacity

CIDR notation expresses routing size using a prefix length from 0 to 32. A /24 contains 256 IPv4 addresses, while a /20 contains 4096. This calculator converts the prefix into a mask, then derives network and broadcast boundaries. The total count is computed as 2 raised to 32 minus the prefix, supporting predictable capacity planning.

Subnet Mask Validation and Prefix Derivation

When you enter a dotted mask, the tool verifies that bits are contiguous, meaning ones appear first and zeros follow. A valid mask like 255.255.252.0 maps to /22, but a noncontiguous value is rejected. This avoids overlap, routing instability, and incorrect host counts. The derived prefix is shown beside results for quick confirmation.

Network, Broadcast, and Host Allocation

Network address equals the input address bitwise AND the mask. Broadcast equals the network OR the wildcard mask, where wildcard is the inverted mask within 32 bits. Usable hosts are typically total minus two, reserving network and broadcast, with special handling for /31 and /32. First and last usable addresses support DHCP pools and static assignment.

Range Compression into Minimal Blocks

For explicit start and end inputs, the calculator generates the smallest set of CIDR blocks that exactly covers the range. It repeatedly selects the largest aligned power of two block starting at the current address that still fits inside the remaining span. This produces clean summaries for firewall objects, ACL entries, and route advertisements, reducing configuration size and improving readability. It also helps engineers standardize objects across environments and vendors safely consistently.

Operational Uses in Inventory and Security

Teams use range outputs to document allocation, check whether an address belongs to private or public space, and detect multicast or link local entries. The class and scope hints help troubleshoot misrouted traffic and NAT assumptions. Sample address lists provide quick sanity checks without enumerating every address in large subnets.

Reporting, Exports, and Audit Readiness

Export files turn calculations into portable evidence. CSV works for spreadsheets and CMDB imports, while PDF supports ticket attachments and policy reviews. Because the report includes binary forms, masks, and boundaries, reviewers can reproduce decisions and confirm intent. Store the CIDR summary and re run the calculator whenever prefix or range changes.

FAQs

1) What is the difference between total addresses and usable hosts?

Total addresses include every value in the block. Usable hosts usually exclude the network and broadcast addresses. For /31 and /32, the calculator applies common operational rules to avoid subtracting unavailable addresses.

2) Why does the calculator reject some subnet masks?

Valid masks must have contiguous one bits followed by contiguous zero bits. A noncontiguous mask can create unpredictable boundaries and overlaps, so the tool blocks it to prevent incorrect ranges and host calculations.

3) How are /31 and /32 handled?

/31 is treated as two usable addresses for point to point links. /32 is treated as one usable address for a single host route. Network and broadcast concepts do not reduce usable counts in these cases.

4) Can I convert a start to end range into CIDR blocks?

Yes. In range mode, the tool produces the smallest set of CIDR blocks that exactly covers the span. This is useful for firewall objects, route summaries, and access control lists.

5) Does this calculator support IPv6 ranges?

This version focuses on IPv4 only. IPv6 has different sizing and representation, so it needs a separate workflow. If you need IPv6 support, the same layout can be extended with 128 bit math.

6) What should I use the CSV and PDF exports for?

CSV is best for spreadsheets, inventory lists, and CMDB imports. PDF is best for tickets, approvals, and audits where a fixed report format is preferred and easy to attach.

Related Calculators

ip network calculatorsubnet calculatorip address plannerwildcard mask calculatoripv4 subnet calculatorip block calculatornetwork address calculatoripv6 subnet calculatorcidr block calculatornetwork size calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.