Enter the first and last IP address of the range with a hyphen (192.168.1.10 - 192.168.1.200) and we list the fewest CIDR blocks that cover the range exactly. You need CIDR when writing a firewall rule, a cloud security group or an access list (ACL). If you enter a CIDR block we show its first and last address. IPv4 and IPv6 are supported.
Runs in your browser The addresses you enter are not sent to a server.
Example: 192.168.1.10 - 192.168.1.200 or 10.0.0.0/22. Both addresses must be the same version (both IPv4 or both IPv6).
Result: 192.168.1.10 - 192.168.1.200
Blocks: 8
Example calculation: 192.168.1.10 - 192.168.1.200. Enter your own range in the box above; the result here updates.
First address
192.168.1.10
Last address
192.168.1.200
Total address count
191
#
CIDR
First address
Last address
Address count
1
192.168.1.10/31
192.168.1.10
192.168.1.11
2
2
192.168.1.12/30
192.168.1.12
192.168.1.15
4
3
192.168.1.16/28
192.168.1.16
192.168.1.31
16
4
192.168.1.32/27
192.168.1.32
192.168.1.63
32
5
192.168.1.64/26
192.168.1.64
192.168.1.127
64
6
192.168.1.128/26
192.168.1.128
192.168.1.191
64
7
192.168.1.192/29
192.168.1.192
192.168.1.199
8
8
192.168.1.200/32
192.168.1.200
192.168.1.200
1
CopyCopy allThis browser cannot run the calculator (BigInt is required). Update your browser.Result: {x}Blocks: {n}Calculate this blockSwap and calculateEntered addressCIDR notationNetwork addressBroadcast addressFirst usable addressLast usable addressFirst addressLast addressUsable host countTotal address countSubnet maskWildcard maskPrefix lengthBlock typeDotted decimalCompressed (RFC 5952)ExpandedIntegerHexadecimalBinaryReverse DNS name/64 prefixIPv4-mapped IPv6IPv4-mapped IPv6 (hexadecimal)6to4 prefixNAT64 addressEmbedded IPv4 (mapped)Embedded IPv4 (6to4)Embedded IPv4 (NAT64)Binary viewAddressMaskNetwork addressBold: network bits · faded: host bitsBlockUsable rangeBroadcastFirst addressLast addressAddress countHosts requestedUsable hostsMaskRequestTotal blocks: {n}Total blocks: {n}; showing the first {shown}.{ip} is in this block.{ip} is not in this block.Addresses left in the block: {n}The range is a single CIDR block.Enter an address.The input is too long (at most {n} characters).Enter a valid IPv4 or IPv6 address.A number with a leading zero (for example 010) is not accepted: some systems read it as an octal number.A zone ID (such as %eth0) is not supported.The subnet mask is not valid: its bits must be contiguous (for example 255.255.255.0).The prefix length is not valid: 0-32 for IPv4, 0-128 for IPv6.Enter an integer or a hexadecimal number starting with 0x.The number is outside the address range (at most 4294967295 for IPv4).Enter the first and last address separated by a hyphen (192.168.1.10 - 192.168.1.200) or a CIDR block.Both addresses must be the same version (both IPv4 or both IPv6).The first address is larger than the last.The new prefix length must be larger than the block's.Enter one network's host count per line.At most {n} networks can be entered.Host counts must be integers of 1 or more.The requested networks do not fit in the block. Use a larger block or reduce the requests.The address must be the same version as the block.This network (RFC 791)Private network (RFC 1918)Shared address space, CGNAT (RFC 6598)Loopback (the device itself)Link-local (automatic local address)IETF protocol assignment (RFC 6890)Documentation and example addresses (RFC 5737, RFC 3849)Network device benchmarking (RFC 2544)MulticastLimited broadcast address (255.255.255.255)Reserved or unassignedCovers several types (includes private ranges)Public address spaceUnspecified address (::)IPv4-mapped IPv6 (::ffff:0:0/96)NAT64 prefix (RFC 6052)Discard prefix (RFC 6666)6to4 (RFC 3056; anycast mode deprecated, RFC 7526)Unique local address, ULA (RFC 4193)Global unicast (2000::/3)
What is calculated?
The fewest CIDR blocks that cover the range completely and without overlap
Each block's address count and a total check (the blocks add up to the number of addresses in the range)
The reverse direction: the first and last address of a single CIDR block
IPv4 and IPv6
How do I read the result?
A CIDR block starts at an address aligned to its own size. If the start or end of a range is not aligned, one block is not enough: 192.168.1.10 – 192.168.1.200 splits into eight blocks (/31, /30, /28, /27, /26, /26, /29, /32).
If a range starts and ends on a block boundary, you get a single block: 10.0.0.0 – 10.0.0.255 is 10.0.0.0/24.
In IPv4 a range can split into up to 62 blocks in the worst case; if you get many blocks, consider widening the range to aligned boundaries (this adds extra addresses to the coverage).
Frequently asked questions
Why did I get so many blocks?
A block must start at an address aligned to its own size; when a range starts and ends unaligned, the blocks first grow and then shrink. If your rule can accept extra addresses, widen the range and use a single block.
What if the first address is larger than the last?
No result is calculated; the page offers to swap the addresses.
Can I mix an IPv4 and an IPv6 address?
No. Both addresses must be the same version; otherwise an error is shown.
CopiedSectionCould not get the result. Reload the page and try again.Switch to light themeSwitch to dark themeOpen menuClose menu