Skip to main content

IP Range Calculator Convert between IP address ranges and CIDR notation, showing total addresses and range details.

IP Range Calculator illustration
🔢

IP Range Calculator

Convert between IP address ranges and CIDR notation, showing total addresses and range details.

1

Choose Mode

Convert an IP range to CIDR notation, or CIDR to a range.

2

Enter IPs or CIDR

Input start/end IPs or a CIDR notation.

3

View Results

See the IP range, total addresses, and covering CIDR notations.

Loading tool...

What Is IP Range Calculator?

The IP Range Calculator converts between IP address ranges (start IP to end IP) and CIDR notation. In range-to-CIDR mode, enter a start and end IP to find the covering CIDR notation(s). In CIDR-to-range mode, enter a CIDR block to see the start and end IP addresses. The calculator shows the total number of IP addresses in the range and, when converting from a range, may produce multiple CIDR blocks if the range does not align to a single CIDR boundary. This is essential for network planning, firewall rules, and IP allocation.

Why Use IP Range Calculator?

  • Bidirectional: range→CIDR or CIDR→range conversion
  • Shows total IP address count
  • Handles non-aligned ranges with multiple CIDRs
  • Essential for network configuration and firewall rules

Common Use Cases

Firewall Configuration

Convert IP ranges to CIDR blocks for firewall and ACL rules.

IP Allocation

Plan IP address allocation by understanding range sizes.

Security

Convert threat IP ranges to CIDR blocks for blocking rules.

Cloud Networking

Plan VPC subnets and IP ranges for cloud infrastructure.

Technical Guide

CIDR to range: given IP/prefix, the network address is IP AND mask, broadcast is network OR (NOT mask). Total IPs = 2^(32-prefix). Range to CIDR uses a greedy algorithm: starting from the start IP, find the largest CIDR block that fits within the range (aligns to the start and does not exceed the end), add it to the result, advance the start IP past the block, and repeat. Each iteration finds the maximum bit alignment of the current IP (trailing zeros in binary) that doesn't overshoot. The algorithm produces the minimum number of CIDR blocks to exactly cover any arbitrary range.

Tips & Best Practices

  • 1
    An arbitrary IP range may require multiple CIDR blocks to represent exactly
  • 2
    CIDR blocks must start at addresses aligned to their size (e.g., /24 starts at x.x.x.0)
  • 3
    Larger CIDR prefix numbers = smaller networks (/32 is one IP, /0 is all IPs)
  • 4
    Use this tool to consolidate multiple IPs into minimal CIDR blocks for firewall rules

Related Tools

Frequently Asked Questions

Q Can any IP range be expressed as a single CIDR?
Only if the range aligns to a CIDR boundary (starts at a multiple of the block size and spans exactly a power of 2 addresses). Otherwise, multiple CIDRs are needed.
Q What does /32 mean?
/32 represents a single IP address. It is the smallest possible CIDR block.
Q How many IPs are in a /24?
A /24 contains 256 IP addresses (2^8), of which 254 are usable for hosts.
Q Why do I get multiple CIDRs for my range?
Your range does not align to a single CIDR boundary. The calculator finds the minimum set of CIDR blocks that exactly cover your specified range.
Q Is this for IPv4 only?
Yes, this calculator handles IPv4 (32-bit) addresses. IPv6 uses 128-bit addresses with different notation.

About This Tool

IP Range Calculator is a free online tool by FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration or installation required.