How to use the CIDR calculator
- 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.
- 2Use Split into smaller subnets to break the block into smaller CIDR ranges, and copy any value with its copy icon.
- 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.
- 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.
Related tools
Subnet Calculator
Calculate network, broadcast, subnet mask, wildcard mask, host range and host count for IPv4 and IPv6, and split a block into smaller subnets.
Binary, Hex & Decimal Converter
Convert numbers between binary, octal, decimal, and hexadecimal. Real-time conversion with input validation and BigInt precision for large values.
Chmod Calculator
Work out Unix file permissions: tick read/write/execute for owner, group and others, or type an octal mode like 755 or a string like rwxr-xr-x. Get the chmod command in numeric and symbolic form, including setuid, setgid and sticky bits.
Hex to Decimal Converter
Convert hexadecimal to decimal as you type, with the positional working shown digit by digit. Exact for values of any size.