Skip to content

Subnet calculator (IPv4 and IPv6)

Enter an IP address with a prefix or mask to get the network, broadcast, first and last usable host, host count and wildcard mask, or split it into smaller subnets.

  • Free, no limits
  • No sign-up
Everything happens in your browser; your data is never uploaded.
  • ✓ Free
  • ✓ No sign-up
  • ✓ Nothing uploaded

Next step

What to do next

How to use it

  1. Enter an address with CIDR prefix (192.168.1.10/24) or mask (10.0.0.1 255.255.240.0), or an IPv6 address.
  2. Use the prefix buttons to try other sizes quickly.
  3. Read the results table.
  4. Optionally split the network into smaller subnets.
Try it now

What the calculator shows

For IPv4, you get:

  • Network address and prefix, e.g. 192.168.1.0/24
  • Subnet mask (255.255.255.0) and wildcard mask (0.0.0.255, used in Cisco ACLs and OSPF)
  • Broadcast address (192.168.1.255)
  • First and last usable host (192.168.1.1 – 192.168.1.254)
  • Usable hosts and total addresses
  • Address type (private, public, loopback, CGNAT and so on) and the legacy class
  • the address and mask in binary, which makes the network/host split visible
  • the previous and next subnet of the same size

For IPv6, you get the compressed and expanded forms, network, first and last address, number of addresses and how many /64 subnets fit. Everything is calculated in your browser.

CIDR prefix cheat sheet

PrefixSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (point-to-point, RFC 3021)
/32255.255.255.25511 (single host)

The rule: total addresses = 2^(32 − prefix). Subtract 2 for the network and broadcast address to get usable hosts, except for /31 and /32.

Worked example

Take 192.168.1.10/24:

  1. The prefix /24 means the first 24 bits are the network part, giving the mask 255.255.255.0.
  2. Network address: the IP AND the mask → 192.168.1.0.
  3. The remaining 8 bits are for hosts: 2^8 = 256 addresses.
  4. Broadcast: all host bits set to 1 → 192.168.1.255.
  5. Usable hosts: 192.168.1.1 to 192.168.1.254, which is 254 hosts.

Now 10.0.0.1 255.255.240.0: the mask equals /20, so the network is 10.0.0.0/20 with 4,096 addresses, usable hosts 10.0.0.1 to 10.0.15.254, and broadcast 10.0.15.255.

Splitting a network into subnets

Choose a longer prefix under Split into smaller subnets and the calculator lists every resulting subnet with its host range and broadcast address. For example, 192.168.1.0/24 split into /26 gives four subnets of 62 hosts each:

SubnetHostsBroadcast
192.168.1.0/26.1 – .62.63
192.168.1.64/26.65 – .126.127
192.168.1.128/26.129 – .190.191
192.168.1.192/26.193 – .254.255

This is the everyday task when you plan VLANs for an office, carve a cloud VPC into public and private subnets, or set up a home lab. Note that cloud providers reserve some addresses in each subnet; AWS, for example, reserves five, so a /24 subnet there has 251 usable addresses.

Private and special address ranges

RangePurpose
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private networks (RFC 1918), not routed on the internet
100.64.0.0/10Carrier-grade NAT (RFC 6598), used by ISPs
127.0.0.0/8Loopback (localhost)
169.254.0.0/16Link-local; an address here usually means DHCP failed
224.0.0.0/4Multicast
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24Reserved for documentation and examples

For IPv6, fe80::/10 is link-local, fc00::/7 is unique local (the private-network equivalent), 2001:db8::/32 is for documentation, and 2000::/3 is global unicast. A standard IPv6 LAN is a /64.

Frequently asked questions

How many hosts are in a /24?

256 addresses, of which 254 are usable hosts: the network address and the broadcast address cannot be assigned.

How do I convert a subnet mask to CIDR?

Count the 1 bits in the mask. 255.255.255.0 has 24, so it is /24. You can also type the mask after the IP and the calculator converts it.

What is a wildcard mask?

The inverse of the subnet mask, such as 0.0.0.255 for /24. Cisco access lists and OSPF use it.

Why does /31 have 2 usable addresses?

RFC 3021 allows /31 on point-to-point links, where no network or broadcast address is needed.

Does it support IPv6?

Yes. Enter an IPv6 address with a prefix, such as 2001:db8::1/48, to get the range and number of addresses and /64 subnets.

Last updated: November 12, 2026

Recommended

Similar tools

If Subnet calculator helped, you may need these too.

See all in category →

People also use