IPv4 range planning

CIDR Calculator & IP Range Converter

Convert a CIDR block to its complete IPv4 range, or enter a start and end address to find the minimal exact CIDR blocks.

CIDR calculator controls and results

Calculator unavailable until JavaScript loads. If this message remains, enable JavaScript and reload. The displayed results are examples only.

Forward conversion

Enter an IPv4 CIDR block

The address can be anywhere inside the block; the result is normalized to its network.

Include / and a prefix from 0 to 32. The IP address alone does not identify its network size.

Calculated locally. Your addresses are not sent anywhere.

Calculated range

192.168.10.64/26

The first and last values include every address in the block.

Network / CIDR
192.168.10.64/26
Start IP
192.168.10.64
End IP
192.168.10.127
Subnet mask
255.255.255.192
Total addresses
64

Your result explained

From prefix to address range

  1. /26 fixes the first 26 of IPv4's 32 bits, leaving 6 variable bits. The block size is 2^6 = 64 addresses.
  2. Setting the 6 variable bits of 192.168.10.77 to zero gives the network address 192.168.10.64. The entered address remains inside 192.168.10.64/26.
  3. The inclusive range is 192.168.10.64 through 192.168.10.127: 64 addresses, counting both endpoints. This is the full range, not a usable-host count.

Reading the slash

What does CIDR notation mean?

CIDR stands for Classless Inter-Domain Routing. It writes an IP address followed by a slash and a network prefix, such as 192.168.1.0/24. IPv4 addresses have 32 bits: /24 fixes the first 24 as network bits, leaving 8 bits to vary within the block. A larger prefix number means a smaller range.

The address count is 2^(32 - prefix), so a /24 contains 2^8 = 256 addresses. These prefix rules are defined in RFC 4632. Have a dotted-decimal mask instead? Use the subnet mask to CIDR converter to find its prefix.

Two useful directions

How to use the CIDR range calculator

CIDR to IP range

Enter notation such as 192.168.10.77/26. The calculator normalizes it to 192.168.10.64/26 and returns the range through 192.168.10.127.

IP range to CIDR

Enter inclusive start and end addresses. If one aligned block cannot represent the range, the calculator returns the smallest exact list of blocks.

From result to review

Convert an IP range into an exact allowlist

Suppose an internal service should accept source addresses from 192.168.1.5 through 192.168.1.20, and its address list accepts CIDR notation. This worked example shows how to describe those 16 addresses without including their neighbors. It is an address-list example, not a complete firewall configuration.

1. Load the example

Choose IP range to CIDR, enter 192.168.1.5 as Start IP and 192.168.1.20 as End IP, then select Convert to CIDR.

2. Why aren't 16 addresses one /28?

Size alone is not enough: a CIDR block must start on a matching binary boundary. Here, 192.168.1.0/28 covers .0 through .15, while 192.168.1.16/28 covers .16 through .31. Our range crosses that boundary, so neither block is an exact match.

The smallest single enclosing block, 192.168.1.0/27, covers 32 addresses. It adds 16 unwanted addresses: .0 through .4 (5 addresses) and .21 through .31 (11 addresses). Use all five exact blocks below when those neighbors must stay outside this address list.

3. Review the CSV coverage

Select Download CSV after calculating. These are the five data rows for this fixed example; editing the calculator does not change this walkthrough.

On narrow screens, scroll the table sideways to see all four columns.

CSV coverage for the fixed example 192.168.1.5 through 192.168.1.20
CIDRFirst addressLast addressAddress count
192.168.1.5/32192.168.1.5192.168.1.51
192.168.1.6/31192.168.1.6192.168.1.72
192.168.1.8/29192.168.1.8192.168.1.158
192.168.1.16/30192.168.1.16192.168.1.194
192.168.1.20/32192.168.1.20192.168.1.201

Starting at each uncovered address, the calculator takes the largest aligned block that fits inside the remaining range. At .5, that is a single /32; at .6, a /31 fits; at .8, a /29 fits. At .16, another /29 would run through .23, so a /30 covers .16 through .19, leaving .20/32.

  1. Check the endpoints: the first row begins at 192.168.1.5 and the last ends at 192.168.1.20.
  2. Check every join: each row starts immediately after the preceding row ends. In this example, .5 is followed by .6, .7 by .8, .15 by .16, and .19 by .20. There are no gaps or overlaps.
  3. Check the count: 1 + 2 + 8 + 4 + 1 = 16, matching the inclusive range size, 20 - 5 + 1 = 16. A matching total alone is not enough; check the endpoints and joins too.

4. Use the export in the right format

  • TXT: one CIDR per line, with no header, for a destination that accepts that format.
  • CSV: the header and coverage columns shown above, for spreadsheet review or a change record. It is not a universal firewall import format.

Keep all five blocks to represent the complete range. Here, /31 and /32 describe address sets, not subnets being assigned to devices, so do not subtract network or broadcast addresses from the list.

Before applying a rule, check the destination's required syntax, source versus destination fields, ports, protocols, rule ordering, and existing permissions. This calculator verifies address coverage, not whether a firewall will allow or deny traffic. It does not inspect your configuration or test network reachability.

Block sizes at a glance

Common CIDR prefixes and IP ranges

Each example shows the complete, inclusive range. Select a CIDR block to load it in the calculator. Address counts are not usable-host counts.

Example IPv4 CIDR blocks, their first and last addresses, and total address counts
CIDR blockStart IPEnd IPTotal addresses
172.16.0.0172.16.255.25565,536
192.168.1.0192.168.1.255256
192.168.1.0192.168.1.6364
192.168.1.0192.168.1.34
192.168.1.0192.168.1.12
192.168.1.9192.168.1.91

For equivalent netmasks and wildcard masks, see the subnet mask reference table.

Ranges versus hosts

Which addresses can a device use?

This tool counts every address, including the network and final address. For assignable host ranges and broadcast details, use the IPv4 subnet calculator. A /31 can use both addresses on a point-to-point link under RFC 3021; a /32 identifies one address. Provider-specific reservations may further reduce the addresses available to devices.

Working with IPv6? Use the IPv6 subnet calculator; the converter on this page accepts IPv4 only.

How we check the calculations

Checks behind these results

Our automated tests check the examples on this page, host-address normalization, the full IPv4 /0 range, and single-address /32 ranges. Range tests check aligned boundaries, consecutive blocks without gaps or overlaps, and address-count totals. Export tests check the TXT and CSV contents, including this five-block example. Invalid addresses, unsupported IPv6 inputs, and reversed ranges are tested as errors.

These are specific regression checks, not an exhaustive test of every possible range or a certification of any firewall configuration. Use the coverage checklist above to review your own result before making a network change.

Common questions

CIDR and IP range FAQ

Can I calculate CIDR from an IP address alone?

An IP address alone does not tell you its network prefix. Supply the prefix or subnet mask from your network configuration, or enter the intended start and end addresses in IP range to CIDR mode. To represent only one address, use /32.

Can I combine separate allowed ranges by entering the lowest and highest IP?

Only if every address between those endpoints should be included. This calculator covers one continuous range, including both endpoints; it does not know about gaps you want to exclude. Convert separate allowed ranges individually so addresses in those gaps are not added to the allowlist.