Skip to main content
忆云竹

IP range to CIDR

Convert an inclusive IPv4 or IPv6 address range into the smallest set of CIDR blocks, with exact address counts.

Both endpoints are included. Use IPv4 or IPv6 consistently; addresses are neither requested nor enumerated.
CIDR

Processed in this browser. Nothing is uploaded or saved.

About this tool

Prepare address ranges for a firewall rule or inventory without accidentally including neighboring addresses.

How to use

Enter the first and last addresses from the same IP family. Both endpoints are included, and the first address must not exceed the last. Results update automatically and show each block’s CIDR, boundaries and address count. Copy or download the full block list.

IPv4 and IPv6 ranges use integer arithmetic without enumerating individual addresses. The blocks cover exactly the requested range; mixed address families are rejected. This is a local calculation and does not check whether addresses are reachable or available to assign.

Common questions

Are the start and end addresses included?

Yes, both endpoints are included. They must belong to the same IP family and appear in increasing order. Calculation does not test reachability or assignment availability.

Why does a short IP range need several CIDR blocks?

CIDR blocks must align with binary boundaries and have power-of-two sizes. A range such as 192.0.2.1–192.0.2.6 cannot be represented by one exact block. Use all returned blocks together; replacing them with one broader prefix would include addresses outside your range.

Comments

0
to join the discussion.
No comments yet.
Reply thread

Follow the complete conversation chronologically; each reply identifies the specific message it answers.