Skip to content
LookupOwl

IPv6 CIDR to range converter

See the first and last address of any IPv6 CIDR prefix, how many addresses it holds and how many /64 subnets fit inside.

IPv6 only, one block per line, like 2001:db8::/32 or 2001:db8:abcd::/48.

What an IPv6 prefix covers

An IPv6 prefix such as 2001:db8::/32 fixes the first 32 bits and leaves the other 96 bits free to take any value. The first address in the range has all the free bits set to zero. The last address has them all set to one, which in hex is a run of f digits. This page works that out for any prefix length from /0 to /128. It also gives the fully expanded 32-digit form, which is what you need when you search logs or sort addresses as text.

PrefixFirst addressLast address
2001:db8::/322001:db8::2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
2001:db8:abcd::/482001:db8:abcd::2001:db8:abcd:ffff:ffff:ffff:ffff:ffff
2001:db8:abcd:12::/642001:db8:abcd:12::2001:db8:abcd:12:ffff:ffff:ffff:ffff

How to use it

  1. Enter prefixesAdd one per line, up to 1,000. Compressed forms like 2001:db8::/32 and fully written forms both work.
  2. Read the sizesThe exact number of addresses is shown as a whole number, even when it has 30 digits. For prefixes of /64 or shorter, you also see how many /64 subnets fit inside, and how many /56 subnets too when the prefix is a /56 or shorter.
  3. Open the other forms when you need themFor a single prefix, the Other forms tab lists the start and end as 32-digit text and as integers, plus the matching reverse DNS zone. Copy them for log searches, for databases that store IPv6 as text or numbers, or when you set up PTR records.

Understanding IPv6 sizes

IPv6 prefixes are huge, so counting addresses is rarely useful. Counting subnets is. A normal LAN is a /64, so the number of /64s in a prefix tells you how many networks you can build from it.

PrefixAddresses/64 subnets inside
/322^96 = 79,228,162,514,264,337,593,543,950,3364,294,967,296
/482^80 = 1,208,925,819,614,629,174,706,17665,536
/562^72 = 4,722,366,482,869,645,213,696256
/642^64 = 18,446,744,073,709,551,6161
  • A /32 is a common size for an ISP allocation. A /48 is a typical site, a /56 a home or small office, and a /64 one subnet (RFC 6177 covers the end-site sizes).
  • /127 is used for point-to-point router links (RFC 6164), and /128 is a single host or a loopback address.

Common errors

  • Host bits set. 2001:db8::1/32 is accepted and rounded down to 2001:db8::/32, with a note saying so.
  • A prefix longer than 128. Valid IPv6 prefix lengths run from /0 to /128.
  • Two :: in one address. The double colon may appear only once. The IPv6 compress tool shows the canonical form of an address.
  • A zone ID. fe80::1%eth0/64 is rejected, because a zone name such as eth0 is not part of a network. Remove the % suffix.
  • No prefix length. A bare address is treated as a /128, a range of one.
  • IPv4 on this page. Use CIDR to IP range for IPv4 blocks.

How it works

The address is read as a 128-bit whole number using exact big-number arithmetic, so no digit is ever rounded. The first address keeps the network bits and zeroes the rest, the last sets the rest to ones, and the count is 2^(128 - prefix). 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. Related standards are RFC 4291 (addressing), RFC 5952 (text form) and RFC 6177 (assignment sizes).

Shell
# The same maths in Python, for checking
python3 -c "import ipaddress as i; n=i.ip_network('2001:db8::/32'); print(n[0], n[-1], n.num_addresses)"

Questions people ask

How do I find the range of an IPv6 prefix?

Set all the host bits to zero for the first address and to one for the last. For 2001:db8::/32, the first 32 bits stay fixed, so the range runs from 2001:db8:: to 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff. The converter does this for any prefix length and also shows the expanded form.

How many addresses are in a /64?

2^64, which is 18,446,744,073,709,551,616. A /64 is the standard size of a single subnet, so you rarely count its addresses one by one. Think of it as one network, and count networks instead of addresses when you plan a layout.

How many /64 subnets are in a /48?

65,536, because 16 bits separate a /48 from a /64, and 2^16 is 65,536. A /56 holds 256 of them. That is why a /48 is generous for a site: it gives each of 65,536 networks a standard-sized subnet. You can check any pair the same way. Subtract the two prefix lengths, then raise 2 to that power.

Why does the last address end in ffff?

In hex, f is the highest digit, and it stands for four bits that are all set to one. The last address of a prefix has every host bit set to one, so the free part becomes a run of f digits. For a /48, that means the last five groups are all ffff.

Is there a broadcast address in IPv6?

No. IPv6 uses multicast instead, so the last address of a prefix is an ordinary, usable address. The first address of a subnet has one small convention: it is the subnet-router anycast address, which routers on that subnet answer to. Everything else can go to hosts.

How do I find the reverse DNS zone of a prefix?

When the prefix length is a multiple of 4, the page shows the matching ip6.arpa zone. For 2001:db8::/32, that is 8.b.d.0.1.0.0.2.ip6.arpa: the first eight hex digits, reversed and separated by dots. Other lengths do not end on a hex digit, so they need several zones instead of one.

Can I convert a start and end IPv6 range into prefixes?

Yes. Use IPv6 range to CIDR. It returns the fewest prefixes that cover your range exactly, so it works in the opposite direction from this page. If the range lines up with a single prefix, you get just one. Otherwise you get a short list, which is normal for a range that does not start and end on a prefix boundary.

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
curl "https://lookupowl.com/api/v1/tools/ip-range-convert?q=2001%3Adb8%3A%3A%2F32"
MCP
claude mcp add --transport http lookupowl https://lookupowl.com/mcp