Skip to main content
IP Range CalculatorPRO
Conversion & EncodingInstant Client-Side Tool

IP Range to CIDR Converter

Find exact covering CIDR blocks.

IP Range to CIDR Converter: inputs and results

Enter an IP address, CIDR prefix, or range. Then check its first and last address below.

Quick presets:

Calculated Boundaries & ParametersReady

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Host Range254

Key Capabilities

  • •100% Client-Side: Zero telemetry or server latency.
  • •RFC Compliant: Exact 32-bit and 128-bit integer precision.
  • •Quick Copy: Instant access to CIDR, mask, and range bounds.
  • •Cross-Platform: Works on desktop, tablet, and mobile browsers.

How IP Range to CIDR Converter Works?

This tool works by repeatedly taking the largest aligned CIDR block that starts at the current address and stays inside the range, until the whole range is covered.

  1. Enter a start and end

    Type a range such as 192.168.1.10 – 192.168.1.100.

  2. Find the largest aligned block

    At 192.168.1.10, the largest aligned block that fits is a /31 (10 is divisible by 2, not by 4).

  3. Advance and repeat

    The converter moves past each block and repeats the search from the next address.

  4. Output the exact list

    The result is the shortest list of non-overlapping CIDR blocks that covers the range exactly.

IP Range to CIDR Converter Formula

The formula picks, at each step, the largest k where Start mod 2^k = 0 and Start + 2^k − 1 ≤ End, and emits Start/(32 − k).

Alignment limit

k ≤ trailing zero bits of Start

A block must start on its boundary.

Size limit

k ≤ floor(log2(End − Start + 1))

The block must fit the remaining range.

Next start

Start = Start + 2^k

Moves past the emitted block.

Maximum block count

≤ 2 × (32 − 1) = 62

Upper limit for any IPv4 range.

Worked example: 192.168.1.10 – 192.168.1.100

192.168.1.10/31     → 192.168.1.10 – 192.168.1.11 (2)
192.168.1.12/30     → 192.168.1.12 – 192.168.1.15 (4)
192.168.1.16/28     → 192.168.1.16 – 192.168.1.31 (16)
192.168.1.32/27     → 192.168.1.32 – 192.168.1.63 (32)
192.168.1.64/27     → 192.168.1.64 – 192.168.1.95 (32)
192.168.1.96/30     → 192.168.1.96 – 192.168.1.99 (4)
192.168.1.100/32    → 192.168.1.100 – 192.168.1.100 (1)
Total = 91 addresses in 7 blocks

IP Range to CIDR Converter Conversion Table

The table converts 10 IP ranges into the minimal set of CIDR blocks.

StartEndAddressesBlocksCIDR List
192.168.1.0192.168.1.2552561192.168.1.0/24
192.168.1.10192.168.1.100917192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/27, 192.168.1.64/27, 192.168.1.96/30, 192.168.1.100/32
10.0.0.010.0.3.2551,024110.0.0.0/22
10.0.0.110.0.0.2542541410.0.0.1/32, 10.0.0.2/31, 10.0.0.4/30, 10.0.0.8/29, 10.0.0.16/28, 10.0.0.32/27, 10.0.0.64/26, 10.0.0.128/26, 10.0.0.192/27, 10.0.0.224/28, 10.0.0.240/29, 10.0.0.248/30, 10.0.0.252/31, 10.0.0.254/32
172.16.0.0172.16.2.2557682172.16.0.0/23, 172.16.2.0/24
203.0.113.64203.0.113.95321203.0.113.64/27
198.51.100.5198.51.100.1284198.51.100.5/32, 198.51.100.6/31, 198.51.100.8/30, 198.51.100.12/32
10.10.0.010.10.5.2551,536210.10.0.0/22, 10.10.4.0/23
192.0.2.200192.0.3.551126192.0.2.200/29, 192.0.2.208/28, 192.0.2.224/27, 192.0.3.0/27, 192.0.3.32/28, 192.0.3.48/29
100.64.0.0100.127.255.2554,194,3041100.64.0.0/10

What is IP Range to CIDR Converter?

The IP Range to CIDR Converter is a tool that converts any start–end IPv4 range into the smallest list of CIDR blocks that covers exactly the same addresses.

Routers, cloud security groups, and most firewalls accept only CIDR prefixes. Arbitrary ranges rarely line up with 1 prefix. 10.0.0.1 – 10.0.0.254 needs 14 blocks, from a /32 up to a /26 and back down.

The output is exact: no address outside the range is added and none inside the range is missed. The Smallest Covering CIDR Calculator handles the opposite trade-off, 1 block that may include extra addresses.

What are the uses of IP Range to CIDR Converter?

There are 5 main uses of the IP Range to CIDR Converter, including cloud security groups, route filters, and registry data conversion.

  • Writing cloud security group rules

    AWS security groups and Azure NSGs accept CIDR entries only.

  • Building BGP prefix filters

    Prefix lists need CIDR entries for every range a peer may announce.

  • Converting WHOIS ranges

    RIR and WHOIS records often show ranges. The converter returns the exact prefixes.

  • Importing DHCP ranges into firewalls

    A DHCP pool such as .100 – .199 becomes a short list of firewall objects.

  • Shrinking geolocation data

    Range-based data sets convert into prefix-based data for routers and CDNs.