IP Range to CIDR Converter

IP Range to CIDR Converter

Local Processing

Convert start and end IPv4 address ranges into the minimal set of covering CIDR blocks.

How It Works & Processing Standards

Convert start and end IPv4 address ranges into the minimal set of covering CIDR blocks.

Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.

Current Limits

  • Maximum input length: 100,000 characters

A range that does not fall on power-of-two boundaries cannot be a single CIDR. This tool splits it into CIDRs with no gaps and no overlap.

What You Can Do

Minimal blocks
The fewest CIDRs that exactly cover the range.
Exact boundaries
No address outside the range is included.

How to Use IP Range to CIDR Converter

  1. 1
    Enter start and end IPThe first and last address of the range.
  2. 2
    CopyCopy the CIDRs, one per line.

Examples

An aligned range
Input: 192.168.1.0 – 192.168.1.255
Result: 192.168.1.0/24
A misaligned range
Input: 10.0.0.5 – 10.0.0.20
Result: 10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/30, 10.0.0.20/32

Common Use Cases

  • Turning a "from X to Y" IP range into firewall or ACL rules
  • Converting country or organisation IP range tables into CIDR lists

Frequently Asked Questions (FAQ)

Why do I get several CIDRs?

A CIDR block has a power-of-two size and must start on a multiple of that size. Ranges that do not fit must be split into several blocks.

Have feedback or ideas for this tool? Suggest & Inquire →