Subnet Calculator

Enter an IP address with a prefix, like 10.0.0.0/16, or with a mask, like 192.168.1.10 255.255.255.0. You get the network and broadcast addresses, the usable host range and the masks, and you can split the block into smaller subnets. IPv6 works too.

Try:
Details
Is an IP in this range?

How CIDR notation works

In 192.168.1.0/24, the number after the slash is the prefix length: how many bits, from the left, identify the network. An IPv4 address has 32 bits, so a /24 leaves 8 bits for hosts, which gives 28 = 256 addresses. The first is the network address and the last is the broadcast address, so 254 can be given to devices.

Common IPv4 prefixes

PrefixSubnet maskAddressesUsable 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
/24255.255.255.0256254
/26255.255.255.1926462
/28255.255.255.2401614
/30255.255.255.25242
/31255.255.255.25422 (point-to-point, RFC 3021)
/32255.255.255.25511 (a single host)

Private address ranges

These ranges are reserved for internal networks (RFC 1918) and are not routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. 100.64.0.0/10 is used by internet providers for carrier-grade NAT. The calculator labels these and other special ranges (loopback, link-local, documentation, multicast) automatically.

Planning a cloud network

When you create an AWS VPC, Azure VNet or Google Cloud VPC, you pick one block, often a /16, and split it into subnets per availability zone and tier. Use Split into subnets to see the ranges. Note that AWS and Azure reserve 5 addresses in every subnet, not just 2, so a /24 gives you 251 usable addresses there. Leave room to grow, and avoid ranges that overlap your office network or VPN.

IPv6 in brief

IPv6 addresses have 128 bits, written as eight groups of hexadecimal. Leading zeros can be dropped and one run of zero groups can be written as ::. A site usually receives a /48 and gives each network a /64, so there are 65,536 subnets of 18 quintillion addresses each. IPv6 has no broadcast address, so the whole range is shown instead.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 256 addresses; the first (network) and last (broadcast) can't be assigned to devices. In AWS and Azure subnets, 5 addresses are reserved, leaving 251.

What is a wildcard mask?

The inverse of the subnet mask: 0.0.0.255 for a /24. Cisco access lists and OSPF use wildcard masks, where 0 bits must match and 1 bits can be anything.

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

They say the same thing in two ways. 255.255.255.0 has 24 bits set to 1, so it equals /24. The calculator accepts either form.

Why does /31 have two usable addresses?

RFC 3021 allows /31 networks for point-to-point links between two routers, where no network or broadcast address is needed, so both addresses are usable.

Is my network information sent anywhere?

No. All calculations run in your browser.