Skip to content
My Tiny Utils

Search tools

Type to find a tool, then press Enter to open it.

CIDR Calculator

Expand a CIDR block into its address range and host counts, or turn a first and last IP into the minimal set of CIDR blocks.

Processed locally in your browser — nothing is uploaded.

CIDR Calculator

Enter a CIDR block like 10.0.0.0/16.

About CIDR Calculator

In CIDR mode, a block like 10.0.0.0/16 expands into its first and last address, usable host range, total addresses, and masks. In range mode, you give a first and last IP and get back the smallest set of CIDR blocks that covers exactly that range and nothing more.

Range-to-CIDR is the awkward direction to do by hand: an arbitrary range rarely lines up with a power-of-two boundary, so covering it takes several blocks of different sizes. That is exactly the list a firewall rule, a security group, or an allowlist needs.

Common uses

  • Convert an IP range from a vendor's allowlist into firewall-ready CIDR blocks
  • Check how many addresses a /20 actually contains before allocating it
  • Confirm two CIDR blocks cover the range you promised a customer

Example

Input

192.168.0.1 – 192.168.0.6

Output

192.168.0.1/32 · 192.168.0.2/31 · 192.168.0.4/31 · 192.168.0.6/32

Limitations

  • IPv4 only
  • The blocks cover the range exactly — they are not merged into a larger block that would include addresses outside it

Frequently asked questions

What does the /16 in 10.0.0.0/16 mean?

The prefix length: the first 16 bits of the address are fixed as the network part, and the remaining 16 bits vary. That gives 2^16 = 65,536 addresses, from 10.0.0.0 to 10.0.255.255.

Why does my IP range turn into several CIDR blocks?

A CIDR block always starts on a power-of-two boundary and covers a power-of-two number of addresses. An arbitrary first-to-last range rarely lines up with that, so covering it exactly takes multiple blocks of different sizes — 192.168.0.1 to 192.168.0.6 needs four.

Do the IP ranges I convert here stay on my machine?

Yes. The expansion and range-to-CIDR math happen in your browser with nothing transmitted or stored, so allowlists and internal network ranges are never exposed to a server.

What's the difference between a CIDR prefix and a subnet mask?

They express the same thing in two notations: /24 and 255.255.255.0 both mean the first 24 bits are the network part. The prefix counts the leading one-bits of the mask, which is why every valid mask maps to exactly one prefix.

Does this CIDR calculator handle IPv6?

No, it is IPv4 only. IPv6 prefixes run to /128 and involve 128-bit arithmetic, and conventions differ — there is no broadcast address and allocation sizes like /64 and /48 follow different rules.