Free IT tool

Subnet and CIDR calculator for IPv4 and IPv6

Work out the network, broadcast, host range and mask of any IPv4 or IPv6 subnet.

Subnet Calculator (IPv4 & IPv6)

IPv4 like 10.0.0.0/22 or IPv6 like 2405:200::/48
Used only when the address has no /prefix
Result

Calculated in your browser. Nothing is sent to our servers.

How to use it

Type an address with a prefix, such as 192.168.10.0/24 or 2405:200::/48, and the calculator shows the network address, usable host range, broadcast address, subnet and wildcard masks, and the address type. For IPv4 you can give a dotted mask instead of a prefix. Results update as you type.

How subnetting works

An IPv4 address is 32 bits. The prefix length (the number after the slash) says how many of those bits identify the network; the rest identify hosts. A /24 leaves 8 host bits, so it holds 256 addresses. The first is the network address and the last is the broadcast address, which leaves 254 usable hosts.

The wildcard mask is the inverse of the subnet mask. Access lists on Cisco routers and OSPF network statements use it.

Special cases

  • /31: used on point-to-point router links (RFC 3021). Both addresses are usable and there is no broadcast.
  • /32: a single host, typically a loopback or a host route.
  • 100.64.0.0/10: carrier-grade NAT space used by ISPs; it is not public and not RFC 1918.

IPv6 in short

IPv6 addresses are 128 bits written as eight groups of hex digits. Leading zeros can be dropped and one run of zero groups can be replaced with ::. LAN segments are almost always /64. A site usually receives a /48 or /56 from its ISP, which gives 65,536 or 256 /64 networks.

IPv4 subnet cheat sheet

PrefixSubnet maskUsable hosts
/20255.255.240.04,094
/21255.255.248.02,046
/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)
FAQs

Common questions

What is the difference between a subnet mask and a prefix?

They describe the same thing. 255.255.255.0 and /24 both mean the first 24 bits are the network. The prefix is shorter to write and is what IPv6 uses.

How many hosts fit in a /26?

A /26 has 64 addresses and 62 usable hosts. Each step down in prefix length doubles the size: /25 has 126 usable, /24 has 254.

Why does my /31 show two usable hosts?

RFC 3021 allows /31 on point-to-point links, where no network or broadcast address is needed. Most modern routers support it and it saves addresses.

What prefix should an IPv6 LAN use?

Use /64 for every LAN segment. SLAAC and many IPv6 features assume a 64-bit interface identifier.

Let's talk

Ready to build infrastructure that stays up?

Tell us about your sites, users and what isn't working today. An engineer will get back to you.