> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Subnet Calculator
- URL: https://itsfoss.com/tools/subnet-calculator/
- Published: 2026-10-30T05:49:39.000Z
- Updated: 2026-10-30T05:49:39.000Z
- Description: Get the network address, broadcast, usable host range and wildcard mask for any CIDR block.
- Author: Abhishek Prakash
- Tags: #onlinetools, Tools

This subnet calculator works out the network details for any IPv4 or IPv6 address. Type an IP with its CIDR prefix, like 192.168.1.10/24, and you get the network address, broadcast address, usable host range, subnet mask and wildcard mask in one go.

You'll need this when you set up a VLAN in your homelab, carve a VPC on a cloud server or write a firewall rule. You can use it as an IP calculator, a CIDR calculator or a subnet mask calculator. It's the same math underneath. I often struggle with these things so I built this for myself and sharing it with you.

Everything runs in your browser. Nothing you type is sent to a server.

## How to use the subnet calculator

Enter an IP address in the input box. You can add the prefix in CIDR form (10.0.0.5/20) or pick a subnet mask from the dropdown (255.255.240.0). Both mean the same thing, so use whichever you have in front of you. 

The results update as you type. If you are working with IPv6, paste the address with its prefix length, like 2001:db8:abcd:12::1/64, and the calculator switches to IPv6 mode on its own.

Want to break a network into smaller pieces? Use the split option to divide a block into equal subnets and see the range of each one.

## What the subnet calculator results mean

An IPv4 address is 32 bits split into two parts. The first part identifies the network, the second part identifies a device on that network. The subnet mask decides where that split happens.

![192.168.10.77/26 split into 26 network bits and 6 host bits]](https://itsfoss.com/content/images/2026/10/subnet-ipv4-anatomy.png)

The calculator gives you each piece of that split. Here's what you get for 192.168.10.77/26.

| Result            | What it means                                                                                     | Example                         |
| ----------------- | ------------------------------------------------------------------------------------------------- | ------------------------------- |
| Network address   | The first address of the subnet. It names the network itself and you can't assign it to a device. | 192.168.10.64                   |
| Broadcast address | The last address of the subnet. A packet sent here reaches every device on the subnet.            | 192.168.10.127                  |
| Usable host range | The addresses you can actually give to computers, phones and servers.                             | 192.168.10.65 to 192.168.10.126 |
| Usable hosts      | How many devices fit. It's the total minus the network and broadcast addresses.                   | 62                              |
| Subnet mask       | The prefix written as four numbers. Routers and older config files still use this form.           | 255.255.255.192                 |
| Wildcard mask     | The mask flipped. Cisco ACLs and OSPF configs ask for this.                                       | 0.0.0.63                        |
| CIDR notation     | The network address plus the number of network bits.                                              | 192.168.10.64/26                |

The network and broadcast addresses are why a /24 gives you 254 usable hosts, not 256\. The two exceptions are /31, which RFC 3021 allows for point-to-point links with both addresses usable, and /32, which is a single host.

## How to calculate a subnet by hand

You don't need a calculator to subnet. It helps to do it by hand a few times, especially if you are preparing for CCNA or a Linux networking exam. Let's work through 192.168.10.77/26.

### Step 1: Turn the prefix into a subnet mask

A /26 means the first 26 bits are 1s and the remaining 6 bits are 0s. The first three octets are full (8 + 8 + 8 = 24 bits), so they're 255\. The fourth octet gets the last 2 network bits, which is 11000000 in binary, or 192.

So /26 is 255.255.255.192.

### Step 2: AND the address with the mask

Only the last octet is interesting here, since the mask is 255 everywhere else. Write 77 and 192 in binary and keep a 1 only where both have a 1.

```
  77  = 0 1 0 0 1 1 0 1   (address)
 192  = 1 1 0 0 0 0 0 0   (mask)
 -------------------------
  64  = 0 1 0 0 0 0 0 0   (network)

```

![Subnet binary](https://itsfoss.com/content/images/2026/10/subnet-binary-and.png)

The network address is 192.168.10.64.

### Step 3: Find the broadcast address

Now set all the host bits to 1 instead of 0\. The last 6 bits become 111111, so the octet is 01111111, which is 127\. The broadcast address is 192.168.10.127.

### Step 4: Get the usable range and host count

Your usable range sits between the two: 192.168.10.65 to 192.168.10.126\. With 6 host bits you have 2^6 = 64 addresses, minus 2, which leaves 62 usable hosts.

### The shortcut: block size

Once you're comfortable, skip the binary. Subtract the interesting mask octet from 256\. For /26 that's 256 - 192 = 64, so subnets start at 0, 64, 128 and 192.

Your address, 77, falls between 64 and 128\. So the network is .64 and the broadcast is one less than the next block, .127\. That's the whole trick, and it works for any prefix.

## Subnet mask cheat sheet

Bookmark this table. It covers every IPv4 prefix from /8 to /32 with its subnet mask, wildcard mask and host count. The ones you'll use most at home and in small offices are /24 to /30.

| CIDR | Subnet mask     | Wildcard mask | Total addresses | Usable hosts       |
| ---- | --------------- | ------------- | --------------- | ------------------ |
| /8   | 255.0.0.0       | 0.255.255.255 | 16,777,216      | 16,777,214         |
| /9   | 255.128.0.0     | 0.127.255.255 | 8,388,608       | 8,388,606          |
| /10  | 255.192.0.0     | 0.63.255.255  | 4,194,304       | 4,194,302          |
| /11  | 255.224.0.0     | 0.31.255.255  | 2,097,152       | 2,097,150          |
| /12  | 255.240.0.0     | 0.15.255.255  | 1,048,576       | 1,048,574          |
| /13  | 255.248.0.0     | 0.7.255.255   | 524,288         | 524,286            |
| /14  | 255.252.0.0     | 0.3.255.255   | 262,144         | 262,142            |
| /15  | 255.254.0.0     | 0.1.255.255   | 131,072         | 131,070            |
| /16  | 255.255.0.0     | 0.0.255.255   | 65,536          | 65,534             |
| /17  | 255.255.128.0   | 0.0.127.255   | 32,768          | 32,766             |
| /18  | 255.255.192.0   | 0.0.63.255    | 16,384          | 16,382             |
| /19  | 255.255.224.0   | 0.0.31.255    | 8,192           | 8,190              |
| /20  | 255.255.240.0   | 0.0.15.255    | 4,096           | 4,094              |
| /21  | 255.255.248.0   | 0.0.7.255     | 2,048           | 2,046              |
| /22  | 255.255.252.0   | 0.0.3.255     | 1,024           | 1,022              |
| /23  | 255.255.254.0   | 0.0.1.255     | 512             | 510                |
| /24  | 255.255.255.0   | 0.0.0.255     | 256             | 254                |
| /25  | 255.255.255.128 | 0.0.0.127     | 128             | 126                |
| /26  | 255.255.255.192 | 0.0.0.63      | 64              | 62                 |
| /27  | 255.255.255.224 | 0.0.0.31      | 32              | 30                 |
| /28  | 255.255.255.240 | 0.0.0.15      | 16              | 14                 |
| /29  | 255.255.255.248 | 0.0.0.7       | 8               | 6                  |
| /30  | 255.255.255.252 | 0.0.0.3       | 4               | 2                  |
| /31  | 255.255.255.254 | 0.0.0.1       | 2               | 2 (point-to-point) |
| /32  | 255.255.255.255 | 0.0.0.0       | 1               | 1 (single host)    |

A quick way to remember it: each step down the table halves the number of addresses. A /25 is half a /24, a /26 is a quarter, and so on.

You'll see a few of these all the time. A /24 is the default for most home routers. A /30 is the classic link between two routers. A /29 or /28 is what ISPs usually hand out when you buy a small block of static IPs.

## CIDR notation explained

CIDR stands for Classless Inter-Domain Routing. In practice, it's the slash and number you see after an IP address. The number is the prefix length, which is how many bits belong to the network.

So 10.0.0.0/8 has 8 network bits and 24 host bits. 172.16.5.0/24 has 24 network bits and 8 host bits. The bigger the number after the slash, the smaller the network.

CIDR replaced the old Class A, B and C system in 1993\. Before that, you could only get a /8, /16 or /24, which wasted a lot of addresses. With CIDR, the split can happen at any bit, so a network can be exactly as big as it needs to be.

You'll run into CIDR blocks everywhere now. AWS, Google Cloud and Azure ask for a CIDR range when you create a VPC or subnet. Docker and Kubernetes use them for container networks. Firewall tools like [ufw](https://itsfoss.com/ufw-ubuntu/) and nftables accept them in rules, so you can allow a whole range with one line.

## Splitting a network into smaller subnets

Say you have 192.168.10.0/24 and want four separate networks for your home, IoT gadgets, guests and servers. Borrow 2 bits from the host part and you get four /26 subnets with 62 usable hosts each.

![Subnet splitting](https://itsfoss.com/content/images/2026/10/subnet-split-24.png)

Equal splits aren't always the right fit. Your home network might need 100 addresses while the server segment needs 20\. That's where VLSM (Variable Length Subnet Masking) comes in. You carve the biggest subnet first, then fit smaller ones into what's left.

From the same /24, you could take a /25 for home (192.168.10.0 to .127, 126 hosts), a /26 for IoT (.128 to .191, 62 hosts), and two /27s for guests and servers (.192 to .223 and .224 to .255, 30 hosts each). No overlap, no wasted space.

## IPv6 prefixes explained

📋

Personally, I am not a fan of IPv6\. It creates more problem than it solves.

IPv6 subnetting uses the same idea as IPv4, just with a lot more room. An IPv6 address is 128 bits, written as eight groups of four hex digits separated by colons. The prefix length still tells you how many of those bits belong to the network.

Leading zeros in a group can be dropped, and one run of all-zero groups can be squashed into a double colon. So 2001:0db8:abcd:0012:0000:0000:0000:0001 becomes 2001:db8:abcd:12::1\. The calculator expands and compresses these for you.

![Subnet ipv6 prefix](https://itsfoss.com/content/images/2026/10/subnet-ipv6-prefix.png)

Most IPv6 addresses you'll deal with follow the same layout. The first 48 bits are the routing prefix your ISP gives you. The next 16 bits are the subnet ID, which is yours to number however you like. The last 64 bits identify the device.

That last part is why every IPv6 LAN is a /64\. Stateless address autoconfiguration (SLAAC), which most devices use to pick their own address, expects a 64-bit interface ID. Make the subnet smaller than /64 and SLAAC stops working.

This changes how you think about subnetting. With IPv4 you count hosts and squeeze. With IPv6 you never run out of hosts in a /64, so you count subnets instead. A /48 gives you 65,536 separate /64 networks.

There's also no broadcast address in IPv6\. It uses multicast instead, so the calculator doesn't show one for IPv6 networks. 

### IPv6 prefix cheat sheet

| Prefix | Number of /64 subnets | Typically used for                         |
| ------ | --------------------- | ------------------------------------------ |
| /32    | 4,294,967,296         | Allocation to an ISP or large organization |
| /48    | 65,536                | A business site or data center             |
| /56    | 256                   | A home connection (common ISP delegation)  |
| /60    | 16                    | A home connection on some ISPs             |
| /64    | 1                     | A single LAN or VLAN                       |
| /127   | n/a (2 addresses)     | Point-to-point link between routers        |
| /128   | n/a (1 address)       | A single host or loopback                  |

How much your ISP gives you depends on the provider. Check your router's WAN status page for the delegated prefix, usually under something like Network -> WAN -> IPv6\. 

A few prefixes are reserved. 2001:db8::/32 is for documentation, which is why it shows up in every example, including this page. fe80::/10 is link-local and fd00::/8 is for private networks, the IPv6 cousin of 192.168.x.x.

## Calculating subnets in the Linux terminal

If you're on Linux, you can find your current subnet without leaving the terminal. The ip command shows every address with its prefix length.

```
ip -4 addr show

```

Look for the line starting with inet, something like inet 192.168.1.42/24\. That /24 is your subnet. Use `ip -6 addr show` for IPv6.

For the actual math, there's ipcalc. It's in the repositories of most distributions. On Ubuntu and Debian, install it with:

```
sudo apt install ipcalc

```

Then give it an address with a prefix:

```
ipcalc 192.168.10.77/26

```

![ipcalc](https://itsfoss.com/content/images/2026/10/ipcalc.webp)

## Limitations

The calculator does math, not network discovery. It tells you what a subnet contains, not which addresses are in use on your network. For that you need a scanner like nmap.

## Frequently asked questions

### What is a subnet?

A subnet is a smaller network carved out of a bigger one. Devices in the same subnet talk to each other directly. Traffic between subnets has to go through a router, which is what lets you keep IoT gadgets away from your laptop or servers away from guests.

### What is a subnet mask?

A subnet mask tells a device which part of an IP address is the network and which part is the host. 255.255.255.0 means the first three octets are the network. It's the same information as the CIDR prefix, written differently.

### What does /24 mean in an IP address?

That's the CIDR notation and it means the first 24 bits are the network part. That's a subnet mask of 255.255.255.0, with 256 addresses and 254 usable hosts. It's the most common size for home and small office networks.

### What is subnet prefix length?

It's the number after the slash in CIDR notation. Some settings screens, including Windows and Android network settings, ask for the prefix length instead of a subnet mask. Enter 24 if your mask is 255.255.255.0.

### How do I find my subnet mask on Linux?

On Linux, run `ip addr` and read the number after the slash. If it's /24, it is 255.255.255.0\. 

### How many usable hosts are in a /30 subnet?

Two. A /30 has 4 addresses, and one goes to the network address and one to the broadcast. That's why /30 was the standard for router-to-router links, though /31 is now used for the same job with no waste.

### What's the difference between a subnet mask and a wildcard mask?

The wildcard mask is the subnet mask with every bit flipped. 255.255.255.0 becomes 0.0.0.255\. Cisco ACLs and OSPF network statements use wildcard masks. Most other tools want the regular mask or the CIDR prefix.

### What are the private IP address ranges?

RFC 1918 sets aside three IPv4 blocks for private networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16\. They aren't routed on the internet, so you can use them freely inside your network. For IPv6, the equivalent is fd00::/8.

### Why is an IPv6 subnet always /64?

SLAAC, the way most devices configure their own IPv6 address, needs a 64-bit interface ID. Use a smaller subnet and devices can't autoconfigure. The only common exceptions are /127 for router-to-router links and /128 for a single address.