What it does
Enter an address with a prefix (or a netmask) to get the network address, the last address, the usable hosts, the netmask and the wildcard mask. You can check whether another address or subnet is inside the range and list the smaller subnets it splits into. When the range touches a special-purpose block such as private, documentation or loopback space, the IANA registry name and RFC are shown.
- Accepted forms:
192.0.2.10/24·10.0.0.0 255.255.0.0·10.0.0.0/255.255.0.0·10.1.2.3 0.0.255.255(wildcard) ·2001:db8::/48· a bare address (read as /32 or /128). - Usable hosts: IPv4 leaves out the network and broadcast addresses, except /31, where both addresses are used on a point-to-point link (RFC 3021), and /32, a single host. IPv6 has no broadcast; only the first address (the Subnet-Router anycast, RFC 4291) is left out. /127 has two (RFC 6164) and /128 one. These are the same rules as Python
ipaddresshosts().
Examples
| Input | Network | Host range | Hosts |
|---|---|---|---|
192.0.2.10/24 | 192.0.2.0 | 192.0.2.1 – 192.0.2.254 | 254 |
10.0.0.0 255.255.0.0 | 10.0.0.0/16 | 10.0.0.1 – 10.0.255.254 | 65,534 |
203.0.113.134/31 | 203.0.113.134/31 | 203.0.113.134 – 203.0.113.135 | 2 |
2001:db8::/126 | 2001:db8::/126 | 2001:db8::1 – 2001:db8::3 | 3 |
2001:db8::/48 | 2001:db8::/48 | 2001:db8::1 – 2001:db8:0:ffff:ffff:ffff:ffff:ffff | 2^80 − 1 |
Common mistakes
- Using a host address as the network: the network of
192.168.1.77/23is192.168.0.0. Firewalls and routing tables reject or reinterpret values with host bits set. - Mixing netmask and wildcard: Cisco ACLs and OSPF use wildcard masks such as
0.0.0.255— the bits of255.255.255.0inverted. - Counting a /31 as zero hosts: on a point-to-point link both addresses are used.
- Leaving documentation addresses in real configs:
192.0.2.0/24,198.51.100.0/24,203.0.113.0/24,2001:db8::/32and3fff::/20are for examples only and are not routed on the internet.
How the check was made
Before release the results were compared with Python ipaddress: network, last address, netmask, wildcard, first and last host, address count and host count for 62 IPv4 and 34 IPv6 inputs (including the /0, /31, /32, /127 and /128 edges), 25 range checks, 9 subnet splits and 16 invalid inputs all matched. The special-purpose list was checked against the 51 blocks (IPv4 26 · IPv6 25) of the registry CSV files downloaded from IANA, including the name and the globally-reachable flag.
FAQ
How do I calculate this on the command line?
With Python: python3 -c "import ipaddress as i; n=i.ip_network('192.0.2.10/24', strict=False); print(n, n.netmask, n.broadcast_address, n.num_addresses)". Some distributions ship an ipcalc package, but its output and options differ between distributions.
Is 100.64.0.0/10 a private range?
No. It is the RFC 6598 shared address space used inside carrier-grade NAT. Like the RFC 1918 private blocks (10/8, 172.16/12, 192.168/16) it is not routed on the internet, but using it on your own network can collide with your provider's addresses.
Is anything I type sent to a server?
No. The calculation happens entirely in your browser. The input is not sent to a server and is not passed to the visitor statistics or the ads this site uses. Details are on the privacy page.