Skip to content
TabBench

Subnet Calculator

Calculate IPv4 and CIDR subnets, host ranges, netmasks, broadcast addresses, and binary bit masks.

Runs in your browser. Nothing you add is uploaded.

What the Subnet Calculator does

Give this calculator an IPv4 address and a prefix length and it shows the subnet the address belongs to: the network and broadcast addresses, the first and last address you can assign to a device, the subnet mask and its wildcard (inverse) mask, how many hosts fit, and a bit-by-bit view of where the network part ends. Switch to IPv6 and it does the same for 128-bit prefixes, including how many /64 networks fit inside a /48 or /56. You can paste an address with its prefix attached, such as 10.20.30.40/22, and it is split into the two fields for you.

How to calculate a subnet

  1. Choose IPv4 or IPv6 at the top.
  2. Type or paste an address. If you paste it with a prefix (192.168.10.77/26), the prefix field updates too.
  3. Pick the prefix length. Each option in the list shows its dotted subnet mask, so you can also choose by mask.
  4. Read the network address, usable host range, broadcast address, wildcard mask and host count. Every value has its own copy button.
  5. Use the binary breakdown to see which bits are network and which are host, or press Apply in the reference table to try another common size.

The Subnet Calculator runs entirely in your browser — nothing you enter is uploaded, stored, or logged.

How it works

Network, broadcast and usable hosts

network   = address AND mask
broadcast = network OR (NOT mask)
usable    = 2^(32 − prefix) − 2

The mask is prefix 1-bits followed by 0-bits. ANDing it with any address in the subnet clears the host bits and gives the network address; setting every host bit gives the broadcast address. Hosts are everything in between. /31 and /32 are special cases with 2 and 1 usable addresses.

Example: 192.168.10.77/26: mask 255.255.255.192, network 192.168.10.64, broadcast 192.168.10.127, usable 192.168.10.65–192.168.10.126 (2^6 − 2 = 62 hosts), wildcard 0.0.0.63.

When to use it

Splitting an office network

A /24 gives 254 usable addresses. Splitting it into four /26 subnets, say staff, guests, printers and cameras, gives four ranges of 62 hosts: .1–.62, .65–.126, .129–.190 and .193–.254. Entering any address shows the boundaries of its range, which is the quickest way to check that a device's static IP really sits inside the subnet you meant.

Planning cloud VPC ranges

AWS, Azure and Google Cloud ask for CIDR blocks when you create a VPC and its subnets, and ranges that overlap cannot be peered or joined by VPN later. Working the blocks out first, for example 10.0.0.0/16 for the VPC with /20 or /24 subnets inside it, avoids that. Cloud providers also reserve a few addresses in every subnet (AWS and Azure reserve five), so their usable count is lower than the standard figure shown here.

Firewall rules and ACLs

Cisco access lists and OSPF network statements take a wildcard mask, the inverse of the subnet mask: 0.0.0.63 for a /26, 0.0.15.255 for a /20. The calculator shows the wildcard next to the mask, so there is no need to subtract each octet from 255 by hand and risk an ACL that matches too much.

Good to know

  • For prefixes up to /30, usable hosts = 2^(32 − prefix) − 2: the first address names the network and the last is the broadcast address.
  • A /31 is shown with 2 usable addresses and a /32 with 1. Point-to-point /31 links (RFC 3021) have no network or broadcast address, and a /32 is a single host.
  • The scope label recognises the RFC 1918 private ranges (10/8, 172.16/12, 192.168/16), loopback (127/8) and link-local (169.254/16). Other special ranges, such as 100.64.0.0/10 used for carrier-grade NAT, are labelled public.
  • The reverse DNS value is the PTR name of the exact address you entered (its octets reversed under in-addr.arpa), not the zone for the whole subnet.
  • The IP class (A, B, C) is shown for reference only. Routing has been classless since 1993, so the prefix length, not the class, decides how big a network is.

Frequently asked questions

What is the difference between network address and broadcast address?

The network address is the first address in a subnet used to identify the network itself. The broadcast address is the last address in the subnet used to send packets to all devices simultaneously. Neither can be assigned to an individual host.

Why do /31 and /32 subnets behave differently?

A /32 prefix represents a single host (often used for loopback interfaces). A /31 prefix has 2 addresses and is defined under RFC 3021 for point-to-point links where broadcast and network addresses are not required.

How do I find the network address by hand?

Use the block size. For a /26 the mask's last octet is 192, so blocks are 256 − 192 = 64 addresses long and start at multiples of 64. The address 192.168.10.77 falls in the block that starts at 64, so the network is 192.168.10.64, the broadcast is 192.168.10.127, and hosts run from .65 to .126.

What are the RFC 1918 private address ranges?

10.0.0.0/8 (10.0.0.0–10.255.255.255), 172.16.0.0/12 (172.16.0.0–172.31.255.255) and 192.168.0.0/16 (192.168.0.0–192.168.255.255). They are not routed on the public internet, so any organisation can use them internally.

How many /64 subnets are in a /48?

65,536 (2^16). A /56, a common allocation for home connections, holds 256. IPv6 LANs are normally /64 because stateless address autoconfiguration (SLAAC) uses the last 64 bits as the interface ID.

Page last updated . Found a wrong result or a mistake on this page? Let us know.