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
Result
Network address
192.168.1.128/26
Netmask 255.255.255.192
Usable hosts
62
64 addresses
| First and last usable addresses | 192.168.1.129 – 192.168.1.190 |
| Broadcast address | 192.168.1.191 |
| Netmask | 255.255.255.192 (/26) |
| Wildcard mask | 0.0.0.63 |
Range type
Private: internal networks, not routed on the internet (192.168.0.0/16, RFC 1918)
Binary view
| Address | 11000000.10101000.00000001.10000010 |
| Netmask | 11111111.11111111.11111111.11000000 |
| Network | 11000000.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
Result
Result
4 /28 subnets
of 16 addresses each
| # | Subnet | Usable hosts | Broadcast |
|---|---|---|---|
| 1 | 192.168.1.128/28 | 192.168.1.129 – 192.168.1.142 | 192.168.1.143 |
| 2 | 192.168.1.144/28 | 192.168.1.145 – 192.168.1.158 | 192.168.1.159 |
| 3 | 192.168.1.160/28 | 192.168.1.161 – 192.168.1.174 | 192.168.1.175 |
| 4 | 192.168.1.176/28 | 192.168.1.177 – 192.168.1.190 | 192.168.1.191 |
IPv6 subnet calculator
Result
Compressed form (RFC 5952)
2001:db8::/48
Number of addresses
280
1,208,925,819,614,629,174,706,176
| Expanded form | 2001:0db8:0000:0000:0000:0000:0000:0000 |
| Prefix start | 2001:db8:: |
| Prefix end | 2001:db8:0:ffff:ffff:ffff:ffff:ffff |
| Netmask | ffff: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
Result
Result
256 /56 subnets
of 4,722,366,482,869,645,213,696 addresses each
| # | Subnet | Last address |
|---|---|---|
| 1 | 2001:db8::/56 | 2001:db8:0:ff:ffff:ffff:ffff:ffff |
| 2 | 2001:db8:0:100::/56 | 2001:db8:0:1ff:ffff:ffff:ffff:ffff |
| 3 | 2001:db8:0:200::/56 | 2001:db8:0:2ff:ffff:ffff:ffff:ffff |
| 4 | 2001:db8:0:300::/56 | 2001:db8:0:3ff:ffff:ffff:ffff:ffff |
| 5 | 2001:db8:0:400::/56 | 2001:db8:0:4ff:ffff:ffff:ffff:ffff |
| 6 | 2001:db8:0:500::/56 | 2001:db8:0:5ff:ffff:ffff:ffff:ffff |
| 7 | 2001:db8:0:600::/56 | 2001:db8:0:6ff:ffff:ffff:ffff:ffff |
| 8 | 2001:db8:0:700::/56 | 2001:db8:0:7ff:ffff:ffff:ffff:ffff |
| 9 | 2001:db8:0:800::/56 | 2001:db8:0:8ff:ffff:ffff:ffff:ffff |
| 10 | 2001:db8:0:900::/56 | 2001:db8:0:9ff:ffff:ffff:ffff:ffff |
| 11 | 2001:db8:0:a00::/56 | 2001:db8:0:aff:ffff:ffff:ffff:ffff |
| 12 | 2001:db8:0:b00::/56 | 2001:db8:0:bff:ffff:ffff:ffff:ffff |
| 13 | 2001:db8:0:c00::/56 | 2001:db8:0:cff:ffff:ffff:ffff:ffff |
| 14 | 2001:db8:0:d00::/56 | 2001:db8:0:dff:ffff:ffff:ffff:ffff |
| 15 | 2001:db8:0:e00::/56 | 2001:db8:0:eff:ffff:ffff:ffff:ffff |
| 16 | 2001:db8:0:f00::/56 | 2001:db8:0:fff:ffff:ffff:ffff:ffff |
Aggregate several prefixes
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 × /56Prefer 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