# What is my IPv6 subnet range?

Computes an IPv6 subnet from an address and a prefix length: the network, the first and last address, the number of addresses and of /64 subnets, the full and compressed address, and the address type.

- Page: https://www.acalculator.org/logic/ipv6-subnet-calculator
- JSON spec: https://www.acalculator.org/logic/ipv6-subnet-calculator.json
- Version: c14870e292f7

## Default answer

Example with the default inputs (IPv6 address 2001:db8:abcd:12::1, Prefix length /64): The subnet 2001:db8:abcd:12::/64 holds 18,446,744,073,709,551,616 addresses (2001:db8:abcd:12:: – 2001:db8:abcd:12:ffff:ffff:ffff:ffff).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| ip | IPv6 address | An IPv6 address such as 2001:db8::1, optionally with its prefix after a slash (2001:db8::1/48). |
| prefix | Prefix length | How many leading bits are the network part (64 for a single LAN, 48 or 56 for a site). |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| cidr | Network | The network address and prefix length. |
| range | Address range | The first address (every host bit 0) and the last address (every host bit 1) of the subnet. |
| total | Addresses | How many addresses the subnet holds: 2^(128 − prefix), written in full. |
| power | Addresses as a power of 2 | 2^(128 − prefix). |
| subnets64 | /64 subnets | How many /64 subnets fit in the prefix: 2^(64 − prefix), for prefixes up to /64. |
| network | Network address | The address with every host bit 0, compressed. |
| last | Last address | The address with every host bit 1, compressed. |
| expanded | Full address | The address typed, with all eight groups written as four hex digits. |
| compressed | Compressed address | The address typed, in the RFC 5952 short form. |
| addressType | Address type | The block of the IPv6 address space the address is in. |

## Method

network = address AND mask, last = network OR NOT mask, where the mask has prefix leading 1 bits of 128; addresses = 2^(128 − prefix).

## Assumptions

- The address may use any RFC 4291 text form: full, with leading zeros left out, with :: once, or with an IPv4 dotted quad as the last 32 bits.
- Results are written in the RFC 5952 form: lowercase hex, no leading zeros, :: for the longest run of two or more zero groups.
- IPv6 has no broadcast address, so every address from the first to the last is counted.

## Worked examples

1. ip = 2001:db8:abcd:12::1, prefix = 64 gives cidr = 2001:db8:abcd:12::/64, range = 2001:db8:abcd:12:: – 2001:db8:abcd:12:ffff:ffff:ffff:ffff, total = 18,446,744,073,709,551,616, power = 2^64, subnets64 = 1, expanded = 2001:0db8:abcd:0012:0000:0000:0000:0001, compressed = 2001:db8:abcd:12::1, addressType = Documentation. Source: RFC 4291, IP Version 6 Addressing Architecture, section 2.2 and 2.3. https://www.rfc-editor.org/rfc/rfc4291; RFC 5952, A Recommendation for IPv6 Address Text Representation, section 4. https://www.rfc-editor.org/rfc/rfc5952; RFC 3849 (2001:db8::/32 documentation prefix), https://www.rfc-editor.org/rfc/rfc3849.
2. ip = 2001:0DB8:0000:0000:0001:0000:0000:0001/48 gives cidr = 2001:db8::/48, last = 2001:db8:0:ffff:ffff:ffff:ffff:ffff, total = 1,208,925,819,614,629,174,706,176, subnets64 = 65,536, compressed = 2001:db8::1:0:0:1. Source: RFC 5952, A Recommendation for IPv6 Address Text Representation, section 4. https://www.rfc-editor.org/rfc/rfc5952 (example 2001:db8::1:0:0:1: the first of two equal runs of zeros is compressed).
3. ip = fe80::1ff:fe23:4567:890a, prefix = 10 gives cidr = fe80::/10, last = febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff, addressType = Link-local unicast. Source: RFC 4291, IP Version 6 Addressing Architecture, section 2.2 and 2.3. https://www.rfc-editor.org/rfc/rfc4291 (section 2.5.6: link-local unicast is FE80::/10).
4. ip = 2001:db8:0:1:1:1:1:1, prefix = 128 gives cidr = 2001:db8:0:1:1:1:1:1/128, range = 2001:db8:0:1:1:1:1:1, total = 1, compressed = 2001:db8:0:1:1:1:1:1. Source: RFC 5952, A Recommendation for IPv6 Address Text Representation, section 4. https://www.rfc-editor.org/rfc/rfc5952 (section 4.2.2: :: must not shorten one 16-bit 0 field; 4.2.3: the longest run is shortened).
5. ip = ::ffff:192.0.2.128/96 gives cidr = ::ffff:0:0/96, expanded = 0000:0000:0000:0000:0000:ffff:c000:0280, total = 4,294,967,296. Source: RFC 4291, IP Version 6 Addressing Architecture, section 2.2 and 2.3. https://www.rfc-editor.org/rfc/rfc4291 (section 2.2 form 3 and 2.5.5.2, IPv4-mapped ::ffff:0:0/96).

## FAQ

### How many addresses are in an IPv6 subnet?

A prefix of length p leaves 128 − p host bits, so the subnet holds 2^(128 − p) addresses. A /64 holds 2^64 = 18,446,744,073,709,551,616 addresses and a /48 holds 2^80.

### How many /64 subnets are in a /48 or a /56?

A /48 holds 2^(64 − 48) = 65,536 subnets of /64, and a /56 holds 2^8 = 256. The calculator shows this count for any prefix up to /64.

### How is an IPv6 address shortened?

RFC 5952 sets one short form: lowercase hex digits, no leading zeros in a group, and :: in place of the longest run of two or more zero groups (the first run if two are equally long). A single zero group stays written as 0.

### Does an IPv6 subnet have a broadcast address?

No. IPv6 has no broadcast; it uses multicast instead. So the calculator lists the first and the last address of the subnet and counts every address between them.

### Why is a /64 the usual subnet size?

IPv6 interface identifiers are 64 bits long for most unicast addresses (RFC 4291, section 2.5.1), and automatic address configuration (SLAAC) expects them. So a single network segment is normally a /64.

### Can I type an IPv4 address inside an IPv6 address?

Yes. RFC 4291 lets the last 32 bits be written as a dotted quad, such as ::ffff:192.0.2.128. The calculator reads it and writes the results in hex groups.

## Sources

- RFC 4291, IP Version 6 Addressing Architecture (text forms in section 2.2, prefixes in 2.3, special addresses in 2.5 and 2.7). https://www.rfc-editor.org/rfc/rfc4291 (retrieved 2026-10-19)
- RFC 5952, A Recommendation for IPv6 Address Text Representation (section 4). https://www.rfc-editor.org/rfc/rfc5952 (retrieved 2026-10-19)
- RFC 4193, Unique Local IPv6 Unicast Addresses (fc00::/7). https://www.rfc-editor.org/rfc/rfc4193 (retrieved 2026-10-19)
- RFC 3849, IPv6 Address Prefix Reserved for Documentation (2001:db8::/32). https://www.rfc-editor.org/rfc/rfc3849 (retrieved 2026-10-19)
