Subnet Calculator

Calculate network, broadcast, usable hosts, and IPv6 prefixes in your browser. Nothing is uploaded or stored.


A subnet calculator works out the boundaries of an IP network from an address and a prefix length or netmask. For IPv4 it gives the network and broadcast addresses, the usable host range, the wildcard mask and the number of hosts; for IPv6 it gives the prefix, the first and last address and the address count. Everything is calculated in your browser.

How to use the subnet calculator

  1. Enter any IPv4 or IPv6 address in the network, for example 192.168.1.130.
  2. Enter the mask as a prefix length (26 or /26) or, for IPv4, as a dotted netmask (255.255.255.192). IPv6 takes a prefix length only.
  3. Click Calculate.

Understanding your results

For 192.168.1.130/26:

FieldResultMeaning
Network192.168.1.128The first address, identifying the subnet itself
Broadcast192.168.1.191The last address, used to reach every host on the subnet
First / last usable.129 – .190The addresses you can assign to devices
Wildcard0.0.0.63The inverted netmask, used in Cisco ACLs and OSPF
Host count62Usable addresses: 2(32 − prefix) minus the network and broadcast addresses
Scopeprivate"private" for private, loopback, link-local and carrier-grade NAT ranges; otherwise "public"

Two prefixes are special: a /31 has two usable addresses and no network or broadcast address (used for point-to-point links, RFC 3021), and a /32 is a single host.

IPv6 has no broadcast address, so the results show the prefix, first and last address, and the number of addresses as a power of two. A /64 is the standard size for a single LAN segment (address autoconfiguration needs it), and sites are commonly given a /48 or /56 to divide into /64s.

IPv4 CIDR cheat sheet

PrefixNetmaskUsable hosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/20255.255.240.04,094
/22255.255.252.01,022
/23255.255.254.0510
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522
/31255.255.255.2542 (point-to-point)
/32255.255.255.2551 (single host)

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 256 addresses; the first is the network address and the last is the broadcast address, leaving 254 for devices.

What does CIDR notation mean?

CIDR (Classless Inter-Domain Routing) writes a network as an address plus the number of leading bits that identify the network, such as 10.0.0.0/8. The remaining bits identify hosts within it.

What is a wildcard mask?

The netmask with every bit inverted: 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF use it, where a 0 bit means "must match" and a 1 bit means "any value".

Why does my cloud provider show fewer usable addresses than this calculator?

Cloud networks reserve extra addresses in each subnet. AWS VPCs and Azure virtual networks, for example, reserve five per subnet (the first four and the last), so a /24 there has 251 usable addresses instead of 254.