IPv6 range to CIDR converter
Get the shortest exact list of CIDR prefixes for an IPv6 start and end address, the way a registry or firewall writes it.
Why an IPv6 range becomes several prefixes
Registry exports, threat feeds and old configuration files sometimes give an IPv6 range as a start and an end address. Routing, firewalls and security groups work in prefixes instead. A prefix must be aligned to its own size, so an arbitrary range almost always needs several of them. This page returns the smallest exact set, so nothing outside your range is included.
For example, 2001:db8::1 to 2001:db8::8 becomes four prefixes:
| Prefix | Covers |
|---|---|
2001:db8::1/128 | 2001:db8::1 |
2001:db8::2/127 | 2001:db8::2 to 2001:db8::3 |
2001:db8::4/126 | 2001:db8::4 to 2001:db8::7 |
2001:db8::8/128 | 2001:db8::8 |
How to use it
- Enter the rangeWrite
start - endorstart to end, one per line, up to 1,000 lines. A hyphen with no spaces works too, because IPv6 addresses never contain hyphens. Short, long or mixed notation is fine, as long as both ends are IPv6. - Check the prefix listEach prefix is shown in short form. For a single range, you also see the first address, last address and size of every prefix.
- Weigh the covering prefixWhen a range needs several prefixes, the page also shows the smallest single prefix that holds it, and how many extra addresses that prefix would let in.
Reading the output
- The worst case. An IPv6 range needs at most 254 prefixes. Ranges that come from real allocations usually need one or two.
- Aligned ranges collapse.
2001:db8:: - 2001:db8:ffff:ffff:ffff:ffff:ffff:ffffis exactly2001:db8::/32. - Odd ends make a long list.
2620:0:2d0:200::7-2620:0:2d0:2df::7needs 76 prefixes. Its covering prefix,2620:0:2d0:200::/56, would let in 608,742,554,432,415,203,327 addresses you did not ask for. That is a clear sign to use the exact list. - Short-form output. Prefixes are written the RFC 5952 way. If you want every digit, run them through IPv6 expand.
Common problems
- The start is after the end. Swap them. The page reports the order problem instead of guessing.
- An IPv4 end address. Both ends must be IPv6. Convert IPv4 ranges with IP range to CIDR.
- A prefix instead of a range. A line like
2001:db8::/32is reported, with a pointer to IPv6 CIDR to range. - Brackets, ports and zone IDs. None of them belong in a range. The page rejects them with a message, so remove them and try again.
- Rule limits. Some firewalls limit the entries per rule. Consider the covering prefix only if the extra addresses are acceptable.
- Ranges typed by hand. If a range is not aligned, the result is a longer list. That is correct, not an error.
How it works
Both ends are read as 128-bit numbers. From the start address, the page repeatedly picks the largest aligned prefix that fits before the end, writes it down and moves past it. That finishes in at most 254 steps, using whole-number arithmetic only. The calculation runs on our server from the text you submit. It is not written to our logs, and it is kept in memory for at most a day. On the website, Google Analytics also records what you enter. See RFC 4291 (addressing) and RFC 5952 (text form). To go the other way, use IPv6 CIDR to range.
Questions people ask
How do I convert an IPv6 range to CIDR?
Give the start and end address, and take the list of prefixes that comes back. The list is the smallest set of prefixes whose union is exactly your range, with no overlap. For 2001:db8::1 to 2001:db8::8, that is four prefixes. If the range happens to line up with one prefix, you get just that one.
Why do I get several prefixes?
A prefix has to start at an address that divides evenly by its size. A range that does not start and end on those boundaries is split into aligned parts, and each part becomes a prefix. A hand-typed range often gives a longer list. Ranges taken from real allocations usually give only one or two.
Is the result the shortest possible?
Yes. The page works from the start address and always takes the largest aligned prefix that still fits before the end. That method gives the fewest prefixes that cover the range exactly, with no overlap. A covering prefix is shorter still, but only because it lets in extra addresses.
What should I do with a very large covering prefix?
Ignore it and use the exact list. A large extra-address count means the covering prefix would let in far more than you intended. Treat it as a shortcut for rough notes, or for cases where the extra addresses are harmless, and not as something to put into a firewall or access rule.
Does it accept ranges written with ::?
Yes. Compressed addresses with ::, fully written addresses and mixed notation are all fine. The prefixes in the result are shown in the canonical short form. If you want every digit written out, run them through the IPv6 expand tool.
Can I convert many ranges at once?
Yes. Put one range on each line, up to 1,000 lines. One request also stops after about 10,000 blocks in total, and lines past that point are reported as errors, so you can send them again in a separate batch. Good and bad lines can sit side by side, and each bad line gets its own message.
What is the difference between a range and a prefix?
A range has a start and an end address and can be any size. A prefix is a range that starts on a boundary and has a size that is a power of two, written as address/length, like 2001:db8::/32. Every prefix is a range, but most ranges are not a single prefix. This page turns the first kind into the second.
Use it from AI, the API or the command line
Every LookupOwl tool is also a free API and an MCP tool, with no key and no account. This one is ip_range_convert. Please be kind to the rate limits.
curl "https://lookupowl.com/api/v1/tools/ip-range-convert?q=2620%3A0%3A2d0%3A200%3A%3A7-2620%3A0%3A2d0%3A2df%3A%3A7"claude mcp add --transport http lookupowl https://lookupowl.com/mcp