Developer Tools
CIDR Range Calculator
Convert IPv4 and IPv6 CIDR blocks to first and last address, total addresses, and netmask. Reverse range to optimal CIDR list, and contains-test IPs.
Calculator mode
Paste one or more CIDR blocks (IPv4 or IPv6) and see the first address, last address, total count, and mask for each. Comma, semicolon, or newline separated.
One CIDR per line, or comma or semicolon separated. Mix IPv4 and IPv6 freely. Bare addresses are treated as host routes (/32 or /128).
Result
3 valid, 0 invalid.
10.0.0.0/24
IPV4 /24
- First
- 10.0.0.0
- Last
- 10.0.0.255
- Total addresses
- 256
- Netmask
- 255.255.255.0
- Hosts
- 254 usable, plus network and broadcast
192.168.1.0/22
IPV4 /22
Host bits set in input (192.168.1.0); canonical network address shown below.
- First
- 192.168.0.0
- Last
- 192.168.3.255
- Total addresses
- 1,024
- Netmask
- 255.255.252.0
- Hosts
- 1,022 usable, plus network and broadcast
2001:db8::/32
IPV6 /32
- First
- 2001:db8::
- Last
- 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
- Total addresses
- 79,228... (approx 10^28)
- Prefix mask
- ffff:ffff::
What this tool covers
- Expand CIDR: bulk convert a paste of CIDR blocks into first address, last address, total count, and netmask. Handles both IPv4 and IPv6 in one list.
- Range to CIDR: the reverse direction. Accepts addresses, dashed ranges, and CIDRs, merges overlapping or adjacent ranges, and emits the minimum set of IPv4 CIDR blocks that cover the same addresses.
- Contains test: check a list of IPs against a CIDR for allow-list, firewall, or routing debugging. Each IP is reported inside, outside, or invalid.
- IPv6 by BigInt: the full 128-bit space is exact. A /8 IPv6 prefix prints its actual count of 2 to the power 120 addresses without overflow.
- RFC 5952 compression: IPv6 output uses the canonical compressed form by default; switch to fully expanded for tooling that needs eight 16-bit groups.
- Local only: nothing you paste is uploaded. All math runs in the browser.
How to use
- Pick a mode at the top: Expand CIDR (CIDR to range), Range to CIDR (the reverse), or Contains test (is an IP inside a CIDR).
- In Expand, paste one CIDR per line, or comma or semicolon separated. Mix IPv4 and IPv6 freely; switch the IPv6 format chip between compressed and fully expanded for the format your tooling expects.
- In Range to CIDR, paste IPv4 entries (10.0.0.5, 10.0.0.0/24, or 10.0.0.5-10.0.0.250) one per line. The tool merges overlapping ranges and emits the smallest set of CIDR blocks that cover the same addresses.
- In Contains, enter a CIDR block on top and a list of IPs to test below. Each IP is reported inside or outside, with the offset from the network start for inside hits.
- Use Copy table, Copy CIDR list, or Copy report to grab a tab-separated or newline-separated result block for spreadsheets, change tickets, or pull requests.
About this tool
CIDR Range Calculator is a browser-based networking tool that handles the three jobs people search for when they paste a CIDR into Google: expand a CIDR block (or a paste of many CIDR blocks) to the first address, last address, total address count, and netmask; reverse the direction by turning a free-form list of IPv4 addresses, ranges, and CIDRs into the minimum set of CIDR blocks that exactly cover the same addresses; and contains-test a list of IPs against a CIDR block to find which addresses fall inside an allow-list, ACL, firewall rule, or routing entry. Expand mode supports both IPv4 (parsed as unsigned 32-bit integers) and IPv6 (parsed and computed with BigInt so the 128-bit space is exact, with RFC 5952 compressed output by default and a fully expanded option for tools that need eight 16-bit groups). It also tolerates a paste of mixed CIDRs separated by newlines, commas, or semicolons, flags any line with host bits set so you can see when 10.0.0.5/24 was meant to be 10.0.0.0/24, and reports the total address count exactly as a thousand-separated number for small blocks and as an approximate power of ten for huge IPv6 prefixes. Range to CIDR mode accepts plain IPv4 addresses, dashed ranges like 10.0.0.5-10.0.0.250, and CIDRs in the same paste, merges overlapping or adjacent ranges into the smallest set of non-overlapping intervals, then runs the standard greedy algorithm (largest aligned block that fits, then recurse on the remainder) to emit the optimal CIDR cover. This is the canonical answer for compressing a long list of allow-listed addresses into the smallest firewall configuration, normalizing scraped ranges before importing them into a routing table, or sanity-checking that two ranges overlap. Contains mode validates each IP, checks it against the CIDR, reports inside or outside, and shows the offset from the network start for inside hits so you can identify exactly where a specific host falls inside a /16 or a /48. Useful when you are debugging a firewall rule, checking whether a logged client IP is in your office VPN range, sizing a VLAN against a planned address pool, normalizing CIDRs pasted from another tool, or compressing an export of allow-listed IPs into the fewest firewall lines possible. All parsing, bit math, BigInt arithmetic, and rendering happens locally in your browser, so the production CIDR plans, IP allow-lists, and ACL drafts you paste here never leave your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Subnet Calculator
IPv4 CIDR network, broadcast, host range, mask, and binary view.
Open tool
DeveloperIPv6 Expander and Compressor
Expand, compress, classify, and derive reverse DNS for any IPv6 address with optional zone and CIDR prefix.
Open tool
DeveloperIP Address Converter
Convert IPv4 between dotted-decimal, decimal, hex, binary, and octal with per-octet breakdown.
Open tool
DeveloperRandom IP Address Generator
Bulk random IPv4 and IPv6 generator with scope filters, CIDR limits, and JSON, CSV, SQL output.
Open tool