Subnet Calculator

Subnet Calculator

Enter any IPv4 address and mask to get the network, broadcast, usable host range, wildcard mask and every subnet in the block.

Planning a network, setting up a VLAN or writing a firewall rule? You need to know exactly which IP addresses belong to a subnet. GoogieHost’s free Subnet Calculator works it out for you in a second.

Enter any IPv4 address and choose a subnet mask (or type it in CIDR form like 192.168.1.10/26). The tool shows the network address, broadcast address, usable host range, number of hosts, wildcard mask, binary values and every other subnet of the same size in the block. Everything runs in your browser, so there is no signup and no limit.

What Does the Subnet Calculator Show?

ResultWhat it means
Network AddressThe first address of the subnet. It identifies the subnet itself and is not given to a device.
Broadcast AddressThe last address of the subnet. Packets sent here reach every device in the subnet.
Usable Host IP RangeThe addresses you can assign to computers, servers, printers and routers.
Total / Usable HostsHow many addresses the subnet has in total, and how many are left after removing the network and broadcast addresses.
Subnet MaskThe mask in dotted decimal form, such as 255.255.255.192.
Wildcard MaskThe inverse of the subnet mask, used in Cisco ACLs and OSPF (for example 0.0.0.63).
CIDR NotationThe network address with its prefix length, such as 192.168.1.128/26.
IP Class & TypeThe old class (A, B, C, D or E) and whether the address is private, public, loopback, CGNAT and so on.
Binary, Hex & IntegerThe IP and mask in binary, the IP in hexadecimal and as a single 32-bit number.
Reverse DNSThe in-addr.arpa name used for PTR records.
All Possible NetworksEvery subnet of the chosen size inside the parent /24, /16 or /8 block, with your subnet highlighted.

How to Use the Subnet Calculator

  1. Enter an IP address: Type any IPv4 address, for example 192.168.1.130. You can also enter 192.168.1.130/26 or 192.168.1.130/255.255.255.192 and the mask is picked up for you.
  2. Choose the subnet mask: Pick a mask from /1 to /32 in the list. Each option shows both the dotted mask and the CIDR prefix.
  3. Click Calculate: The results appear instantly. Click the copy icon next to any value to copy it.

Click Sample to see a worked example, or Reset to start again.

What Is a Subnet?

A subnet (short for subnetwork) is a smaller network carved out of a larger IP address block. Every IPv4 address has 32 bits. The first part identifies the network and the rest identifies the host (the device). The subnet mask tells devices where that split is.

Subnetting lets you split one block into several smaller networks. That keeps broadcast traffic down, separates departments or servers for security, and avoids wasting addresses.

Subnet Mask vs CIDR Notation

A subnet mask and a CIDR prefix say the same thing in two ways. The mask 255.255.255.0 has 24 one-bits, so it is written as /24 in CIDR notation. A /26 mask has 26 one-bits, which is 255.255.255.192.

To convert a whole CIDR block into an IP range, or to turn a list of IP ranges into CIDR blocks, use our CIDR Calculator.

How to Calculate a Subnet (Worked Example)

Let’s calculate the subnet for 192.168.1.130/26 by hand:

  1. Find the block size: A /26 leaves 32 − 26 = 6 host bits, so each subnet has 26 = 64 addresses.
  2. Find the network address: Subnets of 64 start at .0, .64, .128 and .192. The address .130 falls in the block that starts at 192.168.1.128.
  3. Find the broadcast address: Add the block size and subtract 1: 128 + 64 − 1 = 192.168.1.191.
  4. Find the usable range: Everything between them: 192.168.1.129 to 192.168.1.190, which is 62 usable hosts.

The formula for usable hosts is 2(32 − prefix) − 2. The two addresses you subtract are the network and broadcast addresses.

Subnet Mask Cheat Sheet (/16 to /32)

Use this subnet chart to find the mask, wildcard mask and number of hosts for common prefix lengths:

CIDRSubnet MaskWildcard MaskTotal AddressesUsable Hosts
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

A /31 has no network or broadcast address. RFC 3021 lets both addresses be used on point-to-point links between two routers. A /32 is a single host, often used in firewall rules and loopback interfaces.

Private IP Address Ranges

These ranges are reserved for private networks (RFC 1918) and are not routed on the public internet. The calculator labels them as Private:

RangeCIDRAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536

The tool also detects loopback (127.0.0.0/8), link-local (169.254.0.0/16), carrier-grade NAT (100.64.0.0/10), multicast and documentation ranges.

Subnetting in the Cloud (AWS, Azure & Google Cloud)

Cloud providers keep some addresses in every subnet for their own use, so you get fewer usable hosts than the standard formula:

  • AWS VPC: Reserves 5 addresses per subnet (the first four and the last one). A /24 gives you 251 usable IPs.
  • Microsoft Azure: Also reserves 5 addresses per subnet, so a /24 gives 251 usable IPs.
  • Google Cloud: Reserves 4 addresses in each primary subnet range.

Always plan cloud subnets with some room to grow, because resizing a subnet later is often not possible.

What Is VLSM?

VLSM (Variable Length Subnet Masking) means using different mask sizes inside the same network. Instead of cutting a /24 into four equal /26 blocks, you could make one /25 for 100 users, one /26 for 50 servers, and two /27 blocks for smaller teams. This wastes fewer addresses.

To plan VLSM, start with the largest subnet first and work down. Use this calculator to check each block, and the “All Possible Networks” table to see which ranges are still free.

IPv4 vs IPv6 Subnetting

IPv4 subnetting is mostly about saving scarce addresses. IPv6 has so many addresses that subnetting is about organising the network instead, and the standard LAN size is always a /64. For IPv6 networks, use our IPv6 Subnet Calculator.

FAQs

What is a subnet calculator?

A subnet calculator takes an IP address and a subnet mask and works out the network address, broadcast address, usable host range, number of hosts and wildcard mask for that subnet.

How many hosts are in a /24 subnet?

A /24 subnet has 256 addresses in total and 254 usable hosts, because the first address is the network address and the last is the broadcast address.

How many usable hosts are in a /26, /27, /28 or /30?

A /26 has 62 usable hosts, a /27 has 30, a /28 has 14, a /29 has 6 and a /30 has 2. The formula is 2 to the power of (32 minus the prefix), minus 2.

What is the difference between the network address and the broadcast address?

The network address is the first address in a subnet and identifies the subnet itself. The broadcast address is the last address and is used to send traffic to every device in that subnet. Neither one is assigned to a device.

What is a wildcard mask?

A wildcard mask is the inverse of a subnet mask. For 255.255.255.0 the wildcard mask is 0.0.0.255. Cisco routers use wildcard masks in access control lists and OSPF network statements.

What subnet mask should I use for my network?

Count how many devices you need, add room for growth, and pick the smallest subnet that fits. For example, 50 devices fit in a /26 (62 hosts), while 200 devices need a /24 (254 hosts).

Can I use this subnet calculator for IPv6?

This tool is for IPv4. For IPv6 addresses and prefixes such as /48, /56 or /64, use the GoogieHost IPv6 Subnet Calculator.

Is this subnet calculator free?

Yes. It is completely free, works on mobile and desktop, needs no signup, and runs in your browser so your IP addresses are not sent to our server.