Technology calculators

Subnet Calculator

Updated Sep 29, 2026 By Infinity Calculator
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 gives you the results. 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

  • CIDR Notation: A short way to write an IP address and its subnet mask together, like 192.168.1.0/24. The number after the slash tells you how many bits are used for the network.1
  • Network Address: The first address in a subnet. It identifies the subnet itself and cannot be assigned to a device.2
  • Broadcast Address: The last address in a subnet. It is used to send a message to every device on that subnet at once.2
  • Usable Hosts: The addresses between the network address and the broadcast address. These are the addresses you can actually assign to devices.
  • Wildcard Mask: The opposite of a subnet mask.7 Router access control lists (ACLs) use it to define which parts of an address must match.7 Some routers also use it in routing protocol settings.
  • Network Class: An older way of categorizing IPv4 addresses. Class A supports millions of hosts, Class B supports thousands, and Class C supports up to 254 hosts.1

IPv4 vs. IPv6

IPv4 addresses are 32 bits long.6 That gives 232, or about 4.3 billion, possible addresses. That sounds like a lot, but the fast growth of the internet put the IPv4 address space on course to run out.1 IPv6 increases the address size from 32 bits to 128 bits.8 IPv6 addresses are written as eight groups of up to four hexadecimal digits separated by colons, and one run of zero groups can be shortened to a double colon.9 An example is 2001:0db8:85a3::8a2e:0370:7334. That is 2128 possible 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 usual size for a single network segment, because the interface ID, the host part of most IPv6 addresses, is required to be 64 bits long.9

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:

  • /30 (255.255.255.252): Provides 2 usable hosts. Often used for point-to-point links between two routers, though a /31 can now do the same job with two addresses instead of four.5
  • /24 (255.255.255.0): Provides 254 usable hosts. A common choice for small to medium LANs.
  • /16 (255.255.0.0): Provides 65,534 usable hosts. Used for large campus networks or data centers.
  • /8 (255.0.0.0): Provides over 16 million usable hosts. IANA hands out address space to the regional internet registries in /8 blocks.1

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). Routing protocols such as OSPF, IS-IS, RIPv2 and BGP4 carry the prefix length with each route, so they support VLSM, while older ones such as the original RIP and IGRP do not.1 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 subnet calculator.


Formulas used

Subnet Mask from CIDR Prefix 1
M = \sim0 \ll (32 - n) \quad \text{i.e. } M = 2^{32} - 2^{32-n}
Wildcard Mask
W = \sim M = 2^{32-n} - 1
Network Address 3
\text{Network} = \text{IP} \;\texttt{AND}\; M
Broadcast Address 2
\text{Broadcast} = \text{Network} \;\texttt{OR}\; W
Total Addresses in Subnet 1
\text{Total} = 2^{32 - n}
Usable Hosts per Subnet 2
\text{Usable Hosts} = 2^{32 - n} - 2
Maximum Subnets (classful)
\text{Subnets} = 2^{n - n_{\text{class}}}
IPv6 Total Addresses 9
\text{Total}_{\text{v6}} = 2^{128 - p}

Frequently asked questions

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.2 The broadcast address is the last address in the subnet. It sends a message to every device on that subnet at once.2 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.7 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) to define which part of an IP address to match.7 Some routers also use it in routing protocol settings, such as OSPF. 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.5 There is no separate network or broadcast address in a /31 subnet.5

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 usual size for a single network segment, because the interface ID, the host part of most IPv6 addresses, is required to be 64 bits long.9 That leaves 64 bits for the network, and 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. The private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.4 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.

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.


Sources

  1. Fuller V, Li T. Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan (RFC 4632). Internet Engineering Task Force. 2006;§ 2 History; § 3.1 Prefix Notation (prefix table); § 5 Routing Implementation Considerations. Accessed September 29, 2026.
  2. Braden R, ed.. Requirements for Internet Hosts -- Communication Layers (RFC 1122). Internet Engineering Task Force. 1989;§ 3.2.1.3 Addressing; § 3.3.6 Broadcasts. Accessed September 29, 2026.
  3. Mogul J, Postel J. Internet Standard Subnetting Procedure (RFC 950). Internet Engineering Task Force. 1985;§ 2.1 Interpretation of Internet Addresses; § 2.2 Changes to Host Software to Support Subnets. Accessed September 29, 2026.
  4. Rekhter Y, Moskowitz B, Karrenberg D, de Groot GJ, Lear E. Address Allocation for Private Internets (RFC 1918). Internet Engineering Task Force. 1996;§ 3 Private Address Space. Accessed September 29, 2026.
  5. Retana A, White R, Fuller V, McPherson D. Using 31-Bit Prefixes on IPv4 Point-to-Point Links (RFC 3021). Internet Engineering Task Force. 2000;§ 1 Introduction; § 2.1 Addressing. Accessed September 29, 2026.
  6. Postel J, ed.. Internet Protocol (RFC 791). Internet Engineering Task Force. 1981;§ 2.3 Addressing. Accessed September 29, 2026.
  7. Configure IP Access Lists. Cisco Systems. 2025;ACL Basics: wildcard (inverse) masks. Accessed September 29, 2026.
  8. Deering S, Hinden R. Internet Protocol, Version 6 (IPv6) Specification (RFC 8200). Internet Engineering Task Force. 2017;§ 1 Introduction (Expanded Addressing Capabilities). Accessed September 29, 2026.
  9. Hinden R, Deering S. IP Version 6 Addressing Architecture (RFC 4291). Internet Engineering Task Force. 2006;§ 2.2 Text Representation of Addresses; § 2.5.1 Interface Identifiers. Accessed September 29, 2026.