IP Range Calculator
Convert CIDR to an IP range — expand a block like 10.0.0.0/24 into its first and last address, usable host range and total count — or convert an IP range to CIDR, turning a start–end pair into the fewest blocks that cover it exactly. Works for IPv4 and IPv6 with exact BigInt math. Everything runs in your browser; nothing is uploaded.
Enter a CIDR block and press Calculate.
All calculation runs locally in your browser with BigInt arithmetic — no address, CIDR block or range is ever sent to a server. Safe for pasting internal subnet plans, firewall allowlists or threat-intel ranges.
What this tool is
- A free, in-browser IP range calculator with two directions: CIDR → range (expand a block like 10.0.0.0/24 to its first and last address, usable host range and total count) and range → CIDR (turn a start–end pair into the fewest CIDR blocks that cover it exactly).
- Handles both IPv4 and IPv6 using exact BigInt arithmetic, so 128-bit ranges and huge address counts are computed without rounding or 32-bit overflow.
- The range → CIDR step produces the minimal, aligned set of blocks — e.g. 10.0.0.0–10.0.0.3 is a single 10.0.0.0/30, and an arbitrary range splits into as few blocks as possible.
- Reports the network and broadcast addresses, usable-host first/last and count (with the right rules for /31 point-to-point and /32 single-host IPv4), and notes that IPv6 reserves no broadcast address.
- Everything runs client-side — no address, block or range is ever sent to a server, so it is safe for internal subnet plans, firewall allowlists and threat-intel ranges.
IP ranges and CIDR notation
An IP range is a contiguous set of addresses, written as a first and last address like 10.0.0.0 – 10.0.0.255. CIDR (Classless Inter-Domain Routing) notation describes an aligned, power-of-two range compactly as an address plus a prefix length, such as 10.0.0.0/24. The prefix is the count of leading bits that stay fixed across the whole block; the remaining host bits vary. An IPv4 address is 32 bits and an IPv6 address is 128 bits, so a /24 fixes 24 of the 32 IPv4 bits and leaves 8 host bits — 28 = 256 addresses.
CIDR → range
To expand a block, set all host bits to 0 for the first (network) address and to 1 for the last (broadcast) address; the total is 2host bits. For IPv4, usable hosts normally exclude the network and broadcast addresses (so a /24 has 254 usable) — except a /31, which is a two-address point-to-point link (RFC 3021) with both usable, and a /32, a single host. IPv6 has no broadcast address, so every address in the block counts as usable.
Range → CIDR
A general start–end range is usually not a single CIDR block, so it is expressed as the smallest set of aligned CIDR blocks whose union is exactly the range. Starting at the first address, the calculator repeatedly takes the largest block that is both aligned to the start address and no larger than the addresses remaining, then continues from the next address. The result is minimal and exact — it never includes an address outside the range.
10.0.0.0/24→ 10.0.0.0 – 10.0.0.255, 256 total, 254 usable.10.0.0.0 – 10.0.0.3→ one block, 10.0.0.0/30.192.168.1.0 – 192.168.1.255→ one block, 192.168.1.0/24.10.0.0.1 – 10.0.0.6→ four blocks: /32, /31, /31, /32.
Where it is used in security
Ranges and CIDR blocks are the vocabulary of firewall rules, security-group and NACL entries, allowlists and denylists, WAF and proxy configuration, VPN routing, and threat-intelligence indicators. A feed often hands you an attacker range as a start–end pair that must become CIDR for a block rule, or a CVE/advisory gives a CIDR you must expand to scope a scan. A wrong prefix either leaves a hole or blocks far more than intended, so converting precisely matters.
Privacy note: every conversion happens in your browser with BigInt arithmetic — no address, CIDR block or range leaves the page. Pasting an internal subnet plan, a firewall allowlist or a sensitive threat-intel range here does not expose it to any server or third party.

Frequently asked questions
What is an IP range and how does it relate to CIDR?
An IP range is a contiguous block of addresses described by its first and last address, for example 10.0.0.0 to 10.0.0.255. CIDR (Classless Inter-Domain Routing) notation writes an aligned power-of-two range compactly as an address plus a prefix length, like 10.0.0.0/24. The prefix is the number of leading bits that are fixed; the remaining bits vary across the block. A /24 fixes 24 of the 32 IPv4 bits, leaving 8 host bits, so 2^8 = 256 addresses from 10.0.0.0 to 10.0.0.255. Every CIDR block is a range, but not every range is a single CIDR block — only ranges whose size is a power of two and whose start is aligned to that size can be written as one block.
How do I convert a CIDR block to an IP range?
Take the prefix length and subtract it from the address width (32 for IPv4, 128 for IPv6) to get the number of host bits. The first address (the network address) is the block address with all host bits set to 0; the last address (the broadcast address in IPv4) has all host bits set to 1; the total count is 2 raised to the host bits. For 10.0.0.0/24 that is 8 host bits: first 10.0.0.0, last 10.0.0.255, total 256. Usable hosts normally exclude the network and broadcast addresses, giving 254 for a /24. This tool does all of that for you and also normalises an address that has host bits set down to its network address.
How do I convert an IP range to CIDR blocks?
A general start–end range usually is not a single CIDR block, so it is expressed as the smallest set of aligned CIDR blocks whose union is exactly the range. The algorithm walks from the start: at each step it picks the largest block that both starts on an address aligned to that block size and does not overrun the end, emits it, then continues from the next address. For example 10.0.0.0–10.0.0.3 is exactly 10.0.0.0/30 (one block), 192.168.1.0–192.168.1.255 is exactly 192.168.1.0/24, and a messy range like 10.0.0.1–10.0.0.6 becomes 10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/31, 10.0.0.6/32. The result is both minimal and exact — no address outside the range is ever included.
Does this support IPv6?
Yes. IPv6 addresses are 128-bit, far beyond what a normal 64-bit number can hold, so the calculator represents every address as a BigInt and does all masking, counting and range splitting in 128-bit arithmetic. It accepts compressed (::) notation, embedded IPv4 (such as ::ffff:192.168.0.1) and zone identifiers, and prints results in canonical compressed form. A /64 or a /48 prefix produces an astronomically large address count, which is shown exactly rather than approximated. Note that IPv6 has no broadcast address and does not reserve the network address the way IPv4 does, so the usable count equals the total.
Why would a security or network engineer use this?
Ranges and CIDR blocks are the vocabulary of firewall rules, security-group and NACL entries, allowlists and denylists, proxy and WAF configuration, VPN routing, and threat-intelligence indicators. A SIEM or threat feed often gives an attacker range as a start–end pair that you then need to express as CIDR for a block rule — or vice versa, you have a CIDR advisory and need to know exactly which addresses it covers before scoping a scan or an incident. Doing this by hand is error-prone, and a wrong prefix can either leave a hole or block far more than intended. Because the tool runs entirely in your browser, you can paste internal or sensitive ranges without exposing them to any third-party service.