ToolDash
CIDR Calculator

CIDR Calculator

Use this CIDR calculator online to turn a CIDR block into its first and last address, netmask and host count, or to turn a start and end address into the fewest CIDR blocks that cover it. IPv4 and IPv6 both work.

  • Free, no sign-up
  • Runs in your browser — nothing is uploaded
  • Instant results, no waiting on a server

Enter a CIDR block such as 10.0.0.0/22 to get its first and last address, netmask and host count, or open the IP range tab to turn a start and end address into the fewest CIDR blocks. IPv4 and IPv6 both work.

IP address with prefix or mask

Try:
ResultsIPv4
CIDR notation
10.0.0.0/22
Subnet mask
255.255.252.0
Wildcard mask
0.0.3.255
Network address
10.0.0.0
Broadcast address
10.0.3.255
First usable host
10.0.0.1
Last usable host
10.0.3.254
Total addresses
1,024
Usable hosts
1,022
Address class
A
Address type
Private network (RFC 1918)
Subnet mask (binary)
11111111.11111111.11111100.00000000
IP address (binary)
00001010.00000000.00000000.00000000
Split into smaller subnets4 × /24
SubnetFirst addressLast address
10.0.0.0/2410.0.0.010.0.0.255
10.0.1.0/2410.0.1.010.0.1.255
10.0.2.0/2410.0.2.010.0.2.255
10.0.3.0/2410.0.3.010.0.3.255
4 subnets

How to use the CIDR calculator

  1. 1To convert CIDR to an IP range, type a block such as 10.0.0.0/22 into the box. The first address, last address, subnet mask, wildcard mask and number of hosts appear below.
  2. 2Use Split into smaller subnets to break the block into smaller CIDR ranges, and copy any value with its copy icon.
  3. 3To convert an IP range to CIDR, open the IP range to CIDR tab and enter the first and last address, for example 192.168.1.10 and 192.168.1.200.
  4. 4Copy the list of CIDR blocks. The calculator returns the fewest blocks that cover the range exactly, with no extra addresses.

What CIDR notation means

CIDR, or Classless Inter-Domain Routing, writes a network as an address followed by a slash and a prefix length, such as 203.0.113.0/24. The prefix length is the number of leading bits that identify the network, and what remains identifies the host. CIDR notation replaced the old class A, B and C system in 1993 because it lets you size a network to fit, and it is how routers, firewalls and cloud providers describe address ranges.

A CIDR block always covers a power-of-two number of addresses starting at a matching boundary: a /24 has 256 addresses, a /22 has 1,024 and a /16 has 65,536. That is why an arbitrary range, like 192.168.1.10 to 192.168.1.200, cannot be written as one block. The CIDR calculator converts an IP range to CIDR by splitting it into the largest aligned blocks that fit, which gives the shortest list, and it never includes an address outside the range you gave.

Going from CIDR to an IP range is simpler, and this CIDR range calculator does it for you. The first address has all host bits set to zero and the last has them set to one. For IPv4 the CIDR to subnet mask conversion is shown too, so /22 becomes 255.255.252.0, with the wildcard mask 0.0.3.255 that routers use in access lists.

IPv6 works the same way with 128-bit addresses. A /64 holds 18,446,744,073,709,551,616 addresses, and the tool displays very large counts as powers of two. All of the calculation happens in your browser.

When developers reach for it

Firewall and security group rules

Convert a vendor's published IP range to CIDR so you can paste it into an allow list that only accepts CIDR blocks.

Checking an address is in a block

Expand a CIDR to its first and last address to see whether an IP falls inside a network.

Cloud network design

Plan VPC and subnet sizes by checking how many addresses each prefix length gives and where each block starts and ends.

Summarising routes

Find the smallest set of CIDR blocks that covers a contiguous range, to keep a route table or ACL short.

Frequently asked questions

How do I convert CIDR to an IP range?

+

Enter the CIDR block, such as 10.0.0.0/22. The first address is the network address and the last is the broadcast address (for IPv4), so 10.0.0.0/22 covers 10.0.0.0 to 10.0.3.255, which is 1,024 addresses.

How do I convert an IP range to CIDR?

+

Open the IP range to CIDR tab and enter the first and last address. The tool returns the shortest list of CIDR blocks that covers exactly that range. A range that is not aligned to a power of two needs several blocks.

What is the difference between a CIDR and a subnet mask?

+

They describe the same thing. The prefix length after the slash counts the network bits, and the subnet mask writes those bits as an address, so /24 is 255.255.255.0 and /16 is 255.255.0.0.

Can it handle IPv6?

+

Yes. Enter an IPv6 CIDR such as 2001:db8::/32, or an IPv6 range, and you get the same results. Both ends of a range must use the same IP version.

Why are there so many blocks for my range?

+

A CIDR block must start at an address that is a multiple of its size. A range that starts or ends in the middle of a block has to be covered by several smaller ones. This is the minimum number possible.

Is anything uploaded?

+

No. The CIDR calculator works entirely in your browser, so your network plans stay private.