IP Subnet Calculator (IPv4 & IPv6 CIDR)

Calculate IPv4 and IPv6 subnets: network, range, netmask, hosts and address type. Split networks, convert IP ranges to CIDR and summarize route lists.

Try:

–

IP address
Expanded
Network address
Broadcast address
First usable host
Last usable host
Usable hosts
Total addresses
Address range
/64 networks
Netmask
Wildcard mask
CIDR notation
Address class
Address type
Interface ID
Embedded IPv4
Address as integer
Address in hex
Reverse DNS name
Reverse DNS zone

Binary

Bold bits are the network part, the rest are host bits.


Split into subnets

#SubnetUsable host rangeBroadcastHosts

IP range to CIDR



Summarize networks

Summarized

    
Smallest single supernet

    

How to use the subnet calculator

Enter an address and its mask. IPv4 takes a prefix (192.168.1.10/24), a netmask (192.168.1.10 255.255.255.0) or a Cisco wildcard mask (10.1.2.3 0.0.255.255). IPv6 takes a prefix, in any valid spelling: 2001:db8:abcd:12::1/64, the full eight groups, […] brackets, a zone such as %eth0 or an embedded IPv4 address like ::ffff:192.0.2.1. Results update as you type.

Below the calculator you can split the network into equal subnets (by count, hosts per subnet or new prefix, with a CSV export), turn an address range into CIDR blocks, and summarize a list of networks.

How the numbers are worked out

The prefix length says how many leading bits name the network; the rest number the addresses in it. The netmask is that many 1 bits, the network address is the address AND the mask, and the last address has every host bit set. An IPv4 block of prefix p holds 232 − p addresses, of which 2 fewer are usable hosts: the network and broadcast addresses. /31 point-to-point links (RFC 3021) and /32 host routes are the exceptions.

IPv6 has no broadcast address, so every address in a block counts. A /64 holds 264 addresses and is the standard size for one LAN: stateless autoconfiguration (SLAAC) needs it. Sites typically get a /48 or /56, which is 65,536 or 256 /64 networks. Use /127 for router-to-router links (RFC 6164).

Writing IPv6 addresses

RFC 5952 fixes one canonical text form: lowercase, no leading zeros in a group, and the longest run of two or more zero groups replaced by ::, so 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329. The expanded form writes all 32 hex digits, which helps when comparing addresses. The reverse DNS name lists those digits backwards under ip6.arpa.

Range Type
2000::/3 Global unicast (public)
fc00::/7 Unique local (ULA), the IPv6 private range
fe80::/10 Link-local
ff00::/8 Multicast
2001:db8::/32, 3fff::/20 Documentation
::ffff:0:0/96 IPv4-mapped
::1/128 Loopback

IPv4 private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918); 100.64.0.0/10 is carrier-grade NAT space. The page also recognizes loopback, link-local, multicast, documentation and reserved blocks of both families.

Ranges and summaries

Range to CIDR covers a first-to-last address range with the fewest aligned blocks, the way firewall and cloud rules need it: 192.168.1.10 to 192.168.1.20 is 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/30 and 192.168.1.20/32.

Summarize merges a list of networks and addresses (one per line) into the fewest CIDR blocks that cover exactly the same addresses, and shows the single smallest supernet containing them all, with how many extra addresses it adds. That is what route aggregation and IP allow-lists need.

Frequently asked questions

How many usable hosts are in a /24?
  1. A /24 holds 256 addresses, but the first (network) and last (broadcast) can’t be assigned to devices. In general an IPv4 network with prefix p has 2^(32 − p) − 2 usable hosts, except /31 and /32.
How many addresses are in an IPv6 /64?

2^64, which is 18,446,744,073,709,551,616. A /56 contains 256 such /64 networks and a /48 contains 65,536.

What is the IPv6 equivalent of 192.168.x.x?

Unique local addresses in fc00::/7. In practice you pick a random 40-bit ID and use fdXX:XXXX:XXXX::/48, as RFC 4193 describes, so two networks that later merge are unlikely to clash.

What is the difference between a netmask and a wildcard mask?

A wildcard mask is the netmask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Cisco ACLs and OSPF use wildcards, where a 0 bit means “must match”. The calculator accepts either form after an IPv4 address.

Is anything I enter sent to a server?

No. Every calculation runs in your browser with JavaScript. The addresses and lists you enter are not uploaded or stored.