Subnet Calculator

Enter an address with a prefix, such as 203.0.113.77/27 or 2001:db8::/48. The network, usable range, mask and host count update as you type.

  • Free
  • No Sign-Up
  • Runs in Your Browser

Examples:

Enter an address and prefix to see its network, range and mask.

How to Use

How to use the Subnet Calculator

  1. 01

    Type an address

    Any IPv4 or IPv6 address, with a /prefix. No prefix means a single host (/32 or /128).

  2. 02

    Or pick a mask

    For IPv4 you can also choose a dotted netmask; the prefix follows it.

  3. 03

    Read the results

    Network, broadcast, first and last usable host, masks and how many addresses fit.

  4. 04

    Split it up

    The split table shows how the block divides into smaller subnets.

IP & Network

About the Subnet Calculator

How CIDR notation works

An IPv4 address is 32 bits. The number after the slash says how many of those bits name the network; the rest number the hosts inside it. A /24 leaves 8 host bits, so it holds 2⁸ = 256 addresses. Every step down halves the block: a /25 holds 128, a /26 holds 64.

In a normal subnet the first address is the network itself and the last is the broadcast address, so neither can be given to a server. That is why a /24 has 254 usable hosts, not 256. Two exceptions: a /31 is a point-to-point link where both addresses are usable (RFC 3021), and a /32 is a single host.

IPv6 has no broadcast address, and subnets are far larger. The usual size for one network is a /64; providers commonly hand customers a /56 or /48.

PrefixAddresses (usable)
/321 (1)
/312 (2, point-to-point)
/304 (2)
/298 (6)
/2816 (14)
/2732 (30)
/2664 (62)
/25128 (126)
/24256 (254)
/221,024 (1,022)
/204,096 (4,094)
/1665,536 (65,534)

Netmask and wildcard mask

The netmask is the prefix written as four numbers: /27 is 255.255.255.224. The wildcard mask is its inverse (0.0.0.31) and is what Cisco ACLs and OSPF statements expect. Both are shown so you can paste whichever your router or firewall wants.

Subnetting for hosting providers

Hosting networks are usually carved from a /24 or larger: a /29 or /28 per dedicated server, single /32s routed to VMs, and a /30 or /31 for each uplink. Routing /32s to VMs, rather than giving each customer a slice of a shared subnet, avoids losing a network and broadcast address per customer and stops one VM claiming its neighbour's address.

What it can't tell you

  • It works on the numbers you enter; it does not check whether a block is routed, announced or in use.
  • Reserved ranges (private, CGNAT, documentation, multicast) are labelled, but whether you may use them depends on your network.

Frequently asked questions

How many usable hosts are in a /24?
254. A /24 holds 256 addresses; the first is the network address and the last is the broadcast address, which leaves 254 for hosts.
What is the difference between /31 and /30?
A /30 has four addresses and two usable hosts. A /31 has two addresses and, on point-to-point links (RFC 3021), both are usable, which saves addresses on router links.
What is a wildcard mask?
The inverse of the netmask: each 255 becomes 0 and each 0 becomes 255. A /24 has netmask 255.255.255.0 and wildcard 0.0.0.255. Cisco ACLs and OSPF use it.
Does it work with IPv6?
Yes. Enter any IPv6 address and prefix; it shows the network, the first and last address and the size of the block, plus how many /64 networks it contains.
Is 100.64.0.0/10 a private range?
It is shared address space for carrier-grade NAT (RFC 6598). It is not routed on the internet, but it is not the same as the RFC 1918 private ranges either.

Every address on your network, watched

Frabs maps each IP to the VM that owns it and stops the abuse coming from it, on Proxmox, Virtualizor, VirtFusion and SolusVM.