Updated on April 14th, 2026

Subnet Calculator

Created By Jehan Wadia

IPv4 Subnet Calculator
IPv6 Subnet Calculator

Introduction

A subnet calculator helps you break a large network into smaller parts called subnets. Subnetting is a key skill in networking that lets you organize IP addresses, improve security, and use your network space wisely. With this tool, you can quickly find important details like the network address, broadcast address, subnet mask, and the number of usable hosts. Just enter an IP address and choose your subnet mask or CIDR notation, and the calculator does the math for you. Whether you are a student learning about networking or an IT professional setting up a real network, this subnet calculator saves you time and helps you avoid mistakes.

How to Use Our Subnet Calculator

Enter an IP address and choose a subnet mask to find out your network address, broadcast address, usable host range, and total number of hosts.

IP Address: Type in the IP address you want to subnet. This is a set of four numbers separated by dots, like 192.168.1.0. It can be any valid IPv4 address you need to work with.

Subnet Mask (CIDR Notation): Pick or type the subnet mask for your network. You can enter it in CIDR format (like /24) or as a full subnet mask (like 255.255.255.0). This value tells the calculator how to split the network and host parts of your IP address.

What Is a Subnet Calculator?

A subnet calculator is a tool that helps you divide a computer network into smaller pieces called subnets. When devices like computers, phones, and servers connect to a network, each one needs its own address, much like how every house on a street needs a unique number. Subnetting is the process of splitting one large network into smaller groups so that traffic flows better, security improves, and IP addresses are used wisely.

How Does Subnetting Work?

Every device on a network gets an IP address, which is a set of numbers that identifies it. An IPv4 address looks like 192.168.1.1, and it has two main parts: the network portion and the host portion. The network portion tells you which group of devices the address belongs to, while the host portion points to a specific device within that group.

A subnet mask is what separates the network part from the host part. For example, a subnet mask of 255.255.255.0 (also written as /24 in CIDR notation) means the first 24 bits identify the network and the last 8 bits identify individual hosts. By changing the subnet mask, you control how many subnets you create and how many devices each subnet can hold.

Key Terms You Should Know

IPv4 vs. IPv6

IPv4 addresses are 32 bits long, which gives us about 4.3 billion possible addresses. That sounds like a lot, but the internet has grown so fast that we are running out. IPv6 was created to solve this problem. IPv6 addresses are 128 bits long, written in hexadecimal and separated by colons, like 2001:0db8:85a3::8a2e:0370:7334. This gives us a nearly unlimited number of addresses.

Subnetting in IPv6 works on the same idea as IPv4—you pick a prefix length to decide how much of the address is the network part and how much is for hosts. A /64 prefix is the most common for individual network segments, leaving 64 bits for host addresses on each subnet.

Why Is Subnetting Important?

Subnetting matters for several reasons. First, it improves network performance by reducing the number of devices sharing the same broadcast traffic. Second, it boosts security because you can separate departments, servers, or guest users onto their own subnets with specific rules. Third, it helps you use IP addresses efficiently instead of wasting large blocks on small groups of devices.

How to Use This Calculator

For IPv4, enter an IP address or a CIDR notation like 192.168.1.0/24. You can choose a network class filter or leave it on "Any." Then pick your subnet mask, subnet bits, or the number of hosts you need from any of the dropdown menus—they all stay in sync. Click Calculate to see the network address, usable host range, broadcast address, wildcard mask, binary representation, and a full list of all possible subnets within that network.

For IPv6, enter an IPv6 address, select a prefix length, and click Calculate. The tool will show you the full and abbreviated address, the network range, total addresses, the number of /64 subnets available, and a binary bitmap visualization of the address.

Practical Subnetting Examples

Understanding subnetting is easier with real-world scenarios. Suppose you manage a small office with 50 employees. Using a /24 subnet gives you 254 usable host addresses—more than enough for current needs with room to grow. If you later need to segment your network into departments, you might split that /24 into four /26 subnets, each supporting up to 62 hosts.

For larger organizations, subnetting becomes essential for managing thousands of devices across multiple locations. A company might use a /16 block and divide it into hundreds of /24 subnets, assigning each to a different floor, building, or department. This kind of structured addressing makes troubleshooting much easier and keeps broadcast domains small.

Common Subnet Masks and Their Uses

Different subnet masks suit different network sizes. Here are some of the most frequently used ones:

Choosing the right mask is about balancing the number of subnets you need against the number of hosts per subnet. Using a mask that is too broad wastes addresses, while using one that is too narrow can leave you without enough room to grow.

Variable Length Subnet Masking (VLSM)

In practice, not every subnet needs the same number of hosts. VLSM lets you use different prefix lengths within the same network to match each segment's actual requirements. For example, a server farm with 100 devices might get a /25 subnet (126 usable hosts), while a point-to-point router link only needs a /30 (2 usable hosts). VLSM is fundamental to efficient modern network design and is supported by all current routing protocols. You can use this calculator to plan each subnet individually by adjusting the mask to fit the number of hosts required, and then verify the results before configuring your routers and switches.

Subnetting and Network Security

Subnetting plays a direct role in network security. By placing different types of traffic on separate subnets, you can apply firewall rules and access control lists at the boundaries between them. For instance, you might place your web servers on one subnet, your database servers on another, and your employee workstations on a third. This way, even if an attacker compromises a workstation, the database servers remain protected behind subnet boundaries with strict traffic filtering.

Tips for Memorizing Subnet Values

If you are studying for a networking certification, memorizing common subnet values will speed up your work. A helpful trick is to remember the "magic number" method: subtract each subnet mask octet from 256 to find the block size. For example, with a mask of 255.255.255.192, the block size is 256 − 192 = 64, meaning subnets increment by 64 (0, 64, 128, 192). This technique works for any octet and helps you quickly identify network and broadcast addresses without a calculator. Of course, for complex scenarios and verification, tools like this subnet calculator remain invaluable.

Related Calculations

Networking often involves more than just subnetting. If you work with numerical analysis in other contexts, you may find our Percentage Calculator useful for calculating utilization rates and bandwidth percentages. For tracking changes in network performance metrics over time, the Percent Change Calculator can help you quantify improvements or degradation. And if you are benchmarking network accuracy or comparing measured versus expected throughput values, the Percent Error Calculator is a handy companion tool.


Frequently Asked Questions

What is CIDR notation and how do I enter it?

CIDR notation is a short way to write an IP address with its subnet mask. It looks like 192.168.1.0/24. The number after the slash tells how many bits are used for the network part. You can type a CIDR address directly into the IP Address field, and the calculator will automatically set the correct subnet mask for you.

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

The network address is the first address in a subnet. It names the subnet itself and cannot be given to any device. The broadcast address is the last address in the subnet. It sends a message to every device on that subnet at once. Neither address can be assigned to a computer or phone.

What is a wildcard mask and when do I need it?

A wildcard mask is the opposite of a subnet mask. Where the subnet mask has a 1, the wildcard mask has a 0, and vice versa. It is used in router access control lists (ACLs) and some routing protocols like OSPF to define which part of an IP address to match. The calculator shows the wildcard mask automatically in the results.

How many usable hosts does a /31 subnet have?

A /31 subnet has 2 usable addresses. It is a special case defined in RFC 3021 and is used for point-to-point links between two routers. There is no separate network or broadcast address in a /31 subnet.

What does the network class filter do?

The network class filter limits the dropdown options to match a specific IP class. If you pick Class C, the subnet mask options start at /24. If you pick Class A, they start at /8. Choose Any if you want to see all possible prefix lengths from /0 to /32.

What does the bitmap visualization show?

The bitmap visualization shows your IP address and subnet mask as binary bits (1s and 0s). Each bit is color-coded: blue for network bits, green for subnet bits, and gray for host bits. This helps you see exactly how the address is split between network and host portions.

How do I calculate an IPv6 subnet?

Scroll down to the IPv6 section. Type your IPv6 address, like 2001:db8::1, and choose a prefix length from the dropdown. Then click Calculate. The tool shows the full address, network range, total addresses, how many /64 subnets fit inside your prefix, and a binary bitmap.

What is the most common IPv6 prefix length?

The most common IPv6 prefix length is /64. This is the standard size for a single network segment. It gives 64 bits for the network and 64 bits for host addresses, which means each /64 subnet can hold a huge number of devices.

What is the difference between a public and private IP address?

A private IP address is used inside a local network and cannot be reached directly from the internet. Common private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. A public IP address is routable on the internet and is assigned by your internet service provider. The calculator tells you if your IP is public or private in the IP Type field.

Why do the dropdowns all change when I pick a different value in one?

All five dropdowns—subnet mask, subnet bits, mask bits, maximum subnets, and maximum hosts—represent the same prefix length in different ways. When you change one, the others sync automatically so they always match. This makes it easy to pick a subnet by whichever value is most useful to you.

What does the All Possible Networks table show?

This table lists every subnet that fits within your classful network range at the chosen prefix length. Each row shows the subnet number, network address, usable host range, and broadcast address. The row for your current subnet is highlighted in blue so you can find it quickly.

Can I use this calculator for supernetting?

Yes. If you set the network class filter to Any, you can choose prefix lengths shorter than the default class boundary. For example, you can select /22 to combine four Class C networks into one larger supernet with 1,022 usable hosts.

What is the Integer ID in the results?

The Integer ID is your IP address converted into a single whole number. Each IPv4 address is really a 32-bit number. For example, 192.168.1.1 equals 3,232,235,777 as an integer. This format is sometimes used in databases and programming.

What does the Hex ID mean?

The Hex ID shows your IP address in hexadecimal (base 16) format. For example, 192.168.1.1 becomes 0xC0A80101. Hexadecimal is commonly used in networking, programming, and packet analysis tools like Wireshark.

How do I reset the calculator to its default values?

Click the Reset button next to the Calculate button. For IPv4, it sets the address back to 192.168.1.1 with a /24 mask and the class filter on Any. For IPv6, it sets the address to 2001:0db8:85a3::8a2e:0370:7334 with a /64 prefix. All results are cleared.


Related Calculators

CIDR Calculator

Visit CIDR Calculator

VLSM Calculator

Visit VLSM Calculator

Bandwidth Calculator

Visit Bandwidth Calculator