IPv4 and IPv6 subnet calculator

Network address, broadcast, netmask and host range of an IPv4 prefix; compressed form, split and ip6.arpa zone of an IPv6 prefix. The calculator also splits a network, aggregates a list of prefixes and gives the reverse DNS zone to create.

The calculation runs in your browser: nothing you type is sent anywhere.

IPv4 subnet calculator

Your parameters

For example 192.168.1.130/26, or 192.168.1.130 255.255.255.192.

Examples

Result

Network address

192.168.1.128/26

Netmask 255.255.255.192

Usable hosts

62

64 addresses

First and last usable addresses192.168.1.129 – 192.168.1.190
Broadcast address192.168.1.191
Netmask255.255.255.192 (/26)
Wildcard mask0.0.0.63

Range type

Private: internal networks, not routed on the internet (192.168.0.0/16, RFC 1918)

Binary view

Address11000000.10101000.00000001.10000010
Netmask11111111.11111111.11111111.11000000
Network11000000.10101000.00000001.10000000

The first 26 bits (coloured) identify the network, the remaining 6 the host.

Reverse DNS zone

  • 1.168.192.in-addr.arpa

Below a /24, the zone is delegated with the RFC 2317 method: your provider creates CNAMEs pointing into a zone such as 128/26.1.168.192.in-addr.arpa.

PTR record of the address

130.1.168.192.in-addr.arpa

Split an IPv4 network

Your parameters

Network to split

192.168.1.128/26

Result

Result

4 /28 subnets

of 16 addresses each

#SubnetUsable hostsBroadcast
1192.168.1.128/28192.168.1.129 – 192.168.1.142192.168.1.143
2192.168.1.144/28192.168.1.145 – 192.168.1.158192.168.1.159
3192.168.1.160/28192.168.1.161 – 192.168.1.174192.168.1.175
4192.168.1.176/28192.168.1.177 – 192.168.1.190192.168.1.191
1 to 4 of 4

IPv6 subnet calculator

Your parameters

For example 2001:db8::/48. Any notation works, expanded or compressed.

Examples

Result

Compressed form (RFC 5952)

2001:db8::/48

Number of addresses

280

1,208,925,819,614,629,174,706,176

Expanded form2001:0db8:0000:0000:0000:0000:0000:0000
Prefix start2001:db8::
Prefix end2001:db8:0:ffff:ffff:ffff:ffff:ffff
Netmaskffff:ffff:ffff::

Subnets contained

  • 16 × /52
  • 256 × /56
  • 4,096 × /60
  • 65,536 × /64

One /64 per LAN: that is the size SLAAC autoconfiguration requires.

Range type

Documentation: reserved for examples, never routed (2001:db8::/32, RFC 3849)

Reverse DNS zone

  • 0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa

PTR record of the address

0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa

Split an IPv6 prefix

Your parameters

Network to split

2001:db8::/48

/

Subnet prefix

Result

Result

256 /56 subnets

of 4,722,366,482,869,645,213,696 addresses each

#SubnetLast address
12001:db8::/562001:db8:0:ff:ffff:ffff:ffff:ffff
22001:db8:0:100::/562001:db8:0:1ff:ffff:ffff:ffff:ffff
32001:db8:0:200::/562001:db8:0:2ff:ffff:ffff:ffff:ffff
42001:db8:0:300::/562001:db8:0:3ff:ffff:ffff:ffff:ffff
52001:db8:0:400::/562001:db8:0:4ff:ffff:ffff:ffff:ffff
62001:db8:0:500::/562001:db8:0:5ff:ffff:ffff:ffff:ffff
72001:db8:0:600::/562001:db8:0:6ff:ffff:ffff:ffff:ffff
82001:db8:0:700::/562001:db8:0:7ff:ffff:ffff:ffff:ffff
92001:db8:0:800::/562001:db8:0:8ff:ffff:ffff:ffff:ffff
102001:db8:0:900::/562001:db8:0:9ff:ffff:ffff:ffff:ffff
112001:db8:0:a00::/562001:db8:0:aff:ffff:ffff:ffff:ffff
122001:db8:0:b00::/562001:db8:0:bff:ffff:ffff:ffff:ffff
132001:db8:0:c00::/562001:db8:0:cff:ffff:ffff:ffff:ffff
142001:db8:0:d00::/562001:db8:0:dff:ffff:ffff:ffff:ffff
152001:db8:0:e00::/562001:db8:0:eff:ffff:ffff:ffff:ffff
162001:db8:0:f00::/562001:db8:0:fff:ffff:ffff:ffff:ffff
1 to 16 of 256

Aggregate several prefixes

Your parameters

IPv4 and IPv6 can be mixed: each family is aggregated separately.

Result

Aggregated list · IPv4

  • 192.168.0.0/22

Smallest single prefix covering everything

192.168.0.0/22

It contains no extra address.

Aggregated list · IPv6

  • 2001:db8::/48

Smallest single prefix covering everything

2001:db8::/48

It contains no extra address.

How the calculation works

A CIDR prefix such as /26 says how many bits, from the left, identify the network. The remaining bits number the hosts. Everything else comes from bitwise operations on the address:

netmask       = n bits set to 1 followed by (32 − n) bits set to 0
wildcard      = NOT netmask
network       = address AND netmask
broadcast     = network OR wildcard
addresses     = 2^(32 − n)
hosts         = 2^(32 − n) − 2      (except /31: 2, and /32: 1)

Two addresses are taken out of each subnet: the first identifies the network itself, the last is used for broadcast. The /31 has been an exception since RFC 3021: on a point-to-point link between two routers there is no one else to reach, so both addresses are usable. A /32 is a single address: a host route, a router loopback or a service IP.

Splitting into N subnets rounds N up to the next power of 2: asking for 5 subnets in a /24 gives 8 /27s. Aggregation does the opposite: it merges contiguous prefixes, such as four consecutive /24s into a /22, and shows the smallest single prefix covering the whole list, with how many extra addresses it includes.

The range type comes from the IANA special-purpose address registries: private (RFC 1918), CGNAT (RFC 6598), loopback, link-local (RFC 3927), documentation (RFC 5737). For reverse DNS, delegation happens on octet boundaries under in-addr.arpa: a /22 needs four /24 zones. Below a /24, RFC 2317 describes the CNAME-based delegation that providers use.

IPv6: what changes

An IPv6 address is 128 bits, written as eight groups of four hex digits. Several notations point to the same address, which gets in the way of log searches and script comparisons. RFC 5952 therefore sets a canonical form: lowercase, leading zeros removed, and the longest run of two or more zero groups replaced once by "::". The calculator shows that form and the expanded form, handy for spreadsheets and DNS zones.

IPv6 has no broadcast address, and every LAN gets a /64: that is the size SLAAC autoconfiguration requires. The question is no longer "how many hosts" but "how many networks". Providers commonly assign a /48 or a /56 to a site:

/48 = 65,536 × /64 = 256 × /56 = 16 × /52
/56 =    256 × /64 =  16 × /60
/40 =    256 × /48 = 65,536 × /56

Prefer splitting on a 4-bit boundary (/48, /52, /56, /60, /64): each subnet then maps to a whole hex digit, addressing plans read at a glance, and the ip6.arpa reverse zone, split on nibbles, is delegated in one piece. A /46 needs four zones, a /48 just one.

Among special ranges, remember unique local addresses (ULA, fc00::/7, in practice fd00::/8 followed by a random 40-bit ID per RFC 4193), link-local fe80::/10, documentation 2001:db8::/32 and 3fff::/20, and multicast ff00::/8, whose fourth digit gives the scope. The "random ULA" button generates a compliant /48.

Sources: RFC 5952 (IPv6 address text representation), RFC 3021 (point-to-point /31), IANA special-purpose address registries for IPv4 and IPv6, RFC 2317 (classless reverse delegation).

We operate our own network, AS206014

Our autonomous system is registered with the RIPE NCC through our network partner. It announces the IPv6 prefix 2a00:6420:ff00::/40, which holds 256 /48s or 65,536 /56s: enter it in the calculator to see it split. The list of IPv6 prefixes announced by AS206014 (fr) is public, and why we run our own network is explained on the page about our autonomous network AS206014.

After the calculation

Once the addressing plan is set, what remains is what the network carries. The TCP throughput calculator shows what latency and packet loss take from a link between two sites, and the download time calculator gives how long a transfer takes from its size and the link speed.

Frequently asked questions

How many usable addresses are in a /24, a /26 or a /30?

A /24 has 256 addresses of which 254 are usable, a /26 has 64 with 62 usable, a /30 has 4 with 2 usable: the network and broadcast addresses are taken out. Two exceptions: a /31 gives two usable addresses on a point-to-point link (RFC 3021), and a /32 is a single address.

What is the netmask of a /26?

255.255.255.192, with a wildcard mask of 0.0.0.63. For the address 192.168.1.130/26, the network is 192.168.1.128, the broadcast 192.168.1.191, and hosts run from 192.168.1.129 to 192.168.1.190.

How many /64s are in a /48?

65,536. A /48 also holds 256 /56s, and a /56 holds 256 /64s. Since every IPv6 LAN uses a /64, a /56 covers 256 LANs and a /48 covers 65,536.

How do you write an IPv6 address in compressed form?

RFC 5952 defines a single notation: lowercase hex digits, leading zeros removed in each group, and the longest run of two or more all-zero groups replaced once by "::". On a tie, the first run is compressed; a single zero group stays "0". So 2001:0db8:0000:0000:0000:0000:0000:0001 is written 2001:db8::1.

What is the 100.64.0.0/10 range?

The shared address space of RFC 6598, reserved for carriers' CGNAT. It is neither public nor private in the RFC 1918 sense. If your router gets a WAN address in 100.64.0.0/10, you are behind your provider's address translation and cannot receive direct inbound connections.

Which reverse DNS zone does an IPv6 prefix use?

A zone under ip6.arpa, split on nibbles: each hex digit becomes a label, in reverse order. 2001:db8::/48 gives 0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. A prefix that does not fall on a 4-bit boundary needs several zones: four for a /46.

Contact

Address

5 B RUE DES NOYERS, 95300 PONTOISE, FRANCE

Let's Talk About Your Project

15 minutes to understand your needs, no commitment.

Book a Slot