Skip to content
toolgrid

No tool found. Try another word.

IP Subnet Calculator

Calculate an IPv4 or IPv6 subnet from an address and prefix or netmask: network and broadcast address, usable host range, wildcard mask and number of hosts.

Examples: 192.168.1.10/24 · 10.0.0.1 255.255.255.0 · 172.16.5.4/20 · 2001:db8::1/48

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the IP Subnet Calculator

  1. 1 Enter an address with a prefix or netmask, such as 192.168.1.10/24, 10.0.0.1 255.255.255.0 or 2001:db8::1/48.
  2. 2 Read the network, host range and sizes as you type.
  3. 3 Click Copy to take all values along, for example into documentation.

About the IP Subnet Calculator

A subnet is a block of addresses that share the same first bits, the prefix. In 192.168.1.10/24 the first 24 bits (192.168.1) are the network and the last 8 bits number the hosts. That gives 256 addresses: 192.168.1.0 is the network address, 192.168.1.255 the broadcast address and 192.168.1.1 to 192.168.1.254 are the 254 usable hosts. The netmask 255.255.255.0 is the same prefix written as an address; the wildcard mask 0.0.0.255, its inverse, is used in Cisco access lists and OSPF.

Each step in the prefix halves the block: /25 has 126 usable hosts, /26 has 62, /27 has 30, /28 has 14, /29 has 6 and /30 has 2. A /31 is a point-to-point link where both addresses are usable (RFC 3021), and a /32 is a single host. Without a prefix, IPv4 is calculated as /24.

For IPv6 the calculator shows the compressed and fully written-out address, the network, the first and last address and the number of addresses, calculated exactly even for very short prefixes. IPv6 has no broadcast address and every address in the block is usable; a normal LAN is a /64, and without a prefix /64 is assumed. Everything is calculated in your browser.

Frequently asked questions

How many hosts are in a /24?

256 addresses, of which 254 are usable for hosts: the first is the network address and the last the broadcast address.

How do I convert a netmask to a prefix?

Count the 1 bits in the netmask: 255.255.255.0 has 24, so it is /24. You can enter either form here, e.g. 10.0.0.1 255.255.240.0 gives /20.

What is a wildcard mask?

The netmask with all bits flipped: 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF use it to say which bits may vary.

Which IPv6 prefix should a network use?

A /64 for every LAN, because SLAAC needs it. Providers usually give a home a /56 or /48, which holds 256 or 65,536 of those /64 networks.