Advertisement
728x90 or 970x250 Ad Space

IP Subnet Calculator

This calculator returns a variety of information regarding Internet Protocol version 4 (IPv4) and IPv6 subnets including possible network addresses, usable host ranges, subnet mask, and IP class.

IPv4 Subnet Calculator

Result

IP Address 190.2.147.13
Network Address 190.2.147.12
Usable Host IP Range 190.2.147.13 - 190.2.147.14
Broadcast Address 190.2.147.15
Total Number of Hosts 4
Number of Usable Hosts 2
Subnet Mask 255.255.255.252
Wildcard Mask 0.0.0.3
Binary Subnet Mask 11111111.11111111.11111111.11111100
IP Class C
CIDR Notation /30
IP Type Public
Short 190.2.147.13 /30
Binary ID 10111110000000101001001100001101
Integer ID 3187839757
Hex ID 0xbe02930d
in-addr.arpa 13.147.2.190.in-addr.arpa
IPv4 Mapped Address ::ffff:be02.930d
6to4 Prefix 2002:be02.930d::/48

IPv6 Subnet Calculator

Result

IP Address 2001:db8:85a3::8a2e:370:7334/64
Full IP Address 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Total IP Addresses 18,446,744,073,709,551,616
Total /64 Networks 18,446,744,073,709,551,616
Network 2001:db8:85a3::
IP Range 2001:db8:85a3:0000:0000:0000:0000 - 2001:db8:85a3:ffff:ffff:ffff:ffff
Advertisement
300x250 or 320x100 Ad Space
ip-subnet-calculator overview
Last updated: June 2026 By CalcOrigin Editorial Team

About IP Subnet Calculator

ip-subnet-calculator 1

The IP subnet calculator is a free online tool that helps network administrators, IT professionals, and students calculate detailed information about IPv4 and IPv6 subnets. By entering an IP address and selecting a subnet mask or prefix length, the calculator instantly returns the network address, broadcast address, usable host range, CIDR notation, IP class, and much more. Whether you are designing a new network, troubleshooting connectivity issues, or studying for a networking certification, this tool simplifies complex subnet calculations that would otherwise require manual binary math.

Subnetting is a fundamental concept in computer networking that involves dividing a larger network into smaller, more manageable subnetworks. This practice improves network performance, enhances security by isolating traffic between segments, and makes more efficient use of IP address space. The IP subnet calculator on this page supports both IPv4 with CIDR notation and IPv6, making it a versatile tool for modern network environments that increasingly rely on IPv6 addressing alongside traditional IPv4 networks.

This calculator also provides supplementary information including the wildcard mask (useful for access control lists), binary representation of the subnet mask, the IP address in hex and integer formats, reverse DNS lookup format (in-addr.arpa), and the IPv4 mapped address for IPv6 transition. For those working with network design, our binary calculator can help with the underlying binary arithmetic that powers all subnet calculations.

How Subnetting Works

ip-subnet-calculator 2

Subnetting works by borrowing bits from the host portion of an IP address and using them for the network portion. Each time you borrow a bit, you double the number of possible subnets but halve the number of available hosts per subnet. The subnet mask determines exactly how many bits are allocated to the network and host portions respectively, and this is why understanding the relationship between subnet masks and address ranges is essential for effective network design.

A router uses the subnet mask to determine whether a destination IP address is on the same local network or a different one. If the network portions match, the destination is local and the router forwards the packet directly. If they differ, the router sends the packet to another router for delivery. This is the fundamental routing decision that happens at every network hop, and it is made possible by the subnetting structure defined in the network configuration.

When you use the IP subnet calculator, it performs the bitwise AND operation between your IP address and subnet mask to calculate the network address. It also calculates the broadcast address by setting all host bits to 1. The usable host range consists of all addresses between the network and broadcast addresses, giving you a complete picture of the address space available for your devices. For a broader understanding of network address management, our hex calculator is useful for working with hexadecimal representations used in IPv6 and MAC addresses.

Subnetting is used in virtually every modern network, from home Wi-Fi networks to global enterprise infrastructures. In a home network, the router typically uses a /24 subnet (255.255.255.0) providing up to 254 devices. In enterprise environments, network engineers create multiple subnets to separate departments like finance, HR, and engineering, improving both security and performance by containing broadcast traffic within each subnet. The calculator on this page helps you plan these subdivisions by showing exactly how many subnets and hosts each mask length provides for your specific IP address.

IPv4 Addresses

ip-subnet-calculator 3

IPv4 (Internet Protocol version 4) is the most widely deployed network addressing architecture in the world, even as the world transitions to IPv6. An IPv4 address is a 32-bit number typically written in dot-decimal notation as four octets separated by periods, such as 192.168.1.1. Each octet ranges from 0 to 255, giving approximately 4.3 billion possible addresses. However, due to the hierarchical structure of subnetting and address allocation, the effective number of usable addresses is significantly lower.

An IPv4 address consists of two main parts: the network prefix (also called the routing prefix) which identifies the network segment, and the host identifier which identifies a specific device within that network. The subnet mask defines the boundary between these two parts. For example, in the address 192.168.1.100 with a 255.255.255.0 (/24) mask, the network portion is 192.168.1 and the host portion is 100.

The key formulas used by this calculator are:

Network Address = IP Address AND Subnet Mask
Broadcast Address = Network Address OR (NOT Subnet Mask)
Total Hosts = 2^(32 - prefix_length)
Usable Hosts = Total Hosts - 2

IPv4 addresses are now largely exhausted at the IANA level, which is why techniques like NAT (Network Address Translation), CIDR, and private addressing have become essential for extending the usability of IPv4 until IPv6 is universally adopted. Understanding IPv4 subnetting remains a critical skill for network professionals, and this calculator helps bridge the gap between theory and practical application.

IPv6 Addresses

ip-subnet-calculator 4

IPv6 (Internet Protocol version 6) was developed specifically to address the exhaustion of IPv4 addresses and introduces several improvements beyond just a larger address space. IPv6 uses 128-bit addresses compared to 32 bits in IPv4, providing approximately 340 undecillion addresses — enough to assign an IP address to every atom on the surface of the Earth many times over. An IPv6 address is written as eight groups of four hexadecimal digits separated by colons, such as 2001:0db8:85a3:0000:0000:8a2e:0370:7334.

IPv6 simplifies subnetting by using a fixed prefix length concept. The network prefix (similar to the subnet mask in IPv4) is expressed as a slash followed by the prefix length, such as /64. The Internet Engineering Task Force (IETF) recommends using /64 subnets for most local networks because it provides enough address space for stateless address autoconfiguration (SLAAC) and other IPv6 features. The structure divides into the global routing prefix, subnet ID, and interface ID portions.

Key IPv6 formulas used:

Network Address = IP Prefix / Prefix Length
Total Addresses = 2^(128 - prefix_length)
Total /64 Networks in Prefix = 2^(prefix_length - 64)

IPv6 eliminates the need for NAT (Network Address Translation) because every device can have a globally unique public address. This simplifies network architecture, improves end-to-end connectivity, and removes the complexity that NAT introduces for applications like peer-to-peer communication and online gaming. However, IPv6 adoption has been gradual, and most networks today operate in a dual-stack configuration supporting both IPv4 and IPv6 simultaneously during the transition period.

Subnet Mask Types Explained

A subnet mask is a 32-bit value that tells network devices which portion of an IP address is the network identifier and which portion is the host identifier. Subnet masks are written in the same dot-decimal format as IP addresses but have a specific structure: the network bits are all 1s (binary) and the host bits are all 0s. This means subnet masks always follow a pattern of consecutive 1s followed by consecutive 0s, with no intermixing.

Default subnet masks correspond to the traditional class-based system. Class A uses 255.0.0.0 (/8), Class B uses 255.255.0.0 (/16), and Class C uses 255.255.255.0 (/24). These are the simplest masks and create the largest possible host ranges for each class. However, default masks are rarely used in modern networks because they are too inflexible for efficient address allocation.

Custom subnet masks extend beyond the default by borrowing host bits. For example, a Class C network using 255.255.255.192 (/26) borrows 2 additional bits, creating 4 subnets of 62 usable hosts each. This is the essence of subnetting — trading available host addresses for additional network segments. The IP subnet calculator on this page works with any valid subnet mask, from /0 to /32 for IPv4, allowing you to experiment with different mask lengths and immediately see the impact on network size and host count.

CIDR Notation Guide

CIDR (Classless Inter-Domain Routing) notation, introduced in 1993, replaced the older classful network addressing system. It allows for more flexible and efficient allocation of IP addresses by eliminating the rigid class boundaries. CIDR notation represents an IP address followed by a slash and the number of bits in the network prefix, such as 192.168.1.0/24. This simple notation conveys both the network address and the subnet mask in a compact, unambiguous format.

Before CIDR, IP addresses were allocated based on class (A, B, or C), which led to significant waste. A Class A network provided 16 million addresses, far more than most organizations needed, while a Class C network provided only 254 — often too few. CIDR solved this by allowing network sizes to be specified with arbitrary prefix lengths, enabling much finer granularity in address allocation. For example, a /28 network provides 16 addresses (14 usable), which is ideal for small branch offices.

The CIDR prefix length directly corresponds to the subnet mask. A /24 equals 255.255.255.0, a /25 equals 255.255.255.128, and a /26 equals 255.255.255.192. Each increment in the prefix length reduces the address space by half. The IP subnet calculator displays both CIDR notation and the corresponding subnet mask simultaneously, helping you build intuition for the relationship between them. For quick binary and decimal conversions needed in networking, our binary calculator is a useful companion tool.

Public vs Private IP Addresses

IP addresses are categorized as either public (globally routable) or private (local use only). Understanding this distinction is essential when using the IP subnet calculator because the calculator identifies the IP type and helps you plan your network addressing scheme accordingly. Public IP addresses are unique across the entire internet and must be registered with a regional internet registry, while private addresses can be used freely within local networks without registration.

Private IP ranges (defined in RFC 1918) are reserved for internal use and are not routable on the public internet:

NAT (Network Address Translation) allows private IP addresses to communicate with the public internet by mapping multiple private addresses to a single public IP. This is why home routers can connect multiple devices using a single internet connection. When you enter an IP address into the subnet calculator, it automatically detects whether the address falls within a private range or is a public address, helping you understand the context of your network configuration.

A special category of IP addresses is the link-local range (169.254.0.0/16), which devices use for Automatic Private IP Addressing (APIPA) when they cannot reach a DHCP server or other configuration source. These addresses are automatically assigned and allow communication only within the local network segment. Another important reserved range is 127.0.0.0/8 for loopback addresses, with 127.0.0.1 being the most commonly used for local software testing. The subnet calculator correctly identifies these special-purpose addresses and their associated network characteristics.

IP Address Classes (A, B, C, D, E)

The traditional IP address class system divides IPv4 addresses into five classes based on the first few bits of the address. While CIDR has largely replaced classful networking, understanding IP classes remains valuable for historical context and because many networks still reference class concepts. The IP subnet calculator identifies the class of any IPv4 address automatically, helping you understand its place in the traditional classification system.

Class A (1.0.0.0 - 126.0.0.0): Default mask /8 (255.0.0.0). Designed for very large networks with up to 16 million hosts. The first bit is always 0. Class A addresses are assigned to large organizations and internet backbone providers.

Class B (128.0.0.0 - 191.255.0.0): Default mask /16 (255.255.0.0). Designed for medium-sized networks with up to 65,534 hosts. The first two bits are 10. Used by universities, mid-sized companies, and ISPs.

Class C (192.0.0.0 - 223.255.255.0): Default mask /24 (255.255.255.0). Designed for small networks with up to 254 hosts. The first three bits are 110. This is the most common class for small businesses and home networks.

Class D (224.0.0.0 - 239.255.255.255): Reserved for multicast groups. The first four bits are 1110. Class D addresses are not used for standard unicast communication and are instead used for one-to-many multicast delivery.

Class E (240.0.0.0 - 255.255.255.255): Reserved for experimental use. The first four bits are 1111. These addresses are not used on the public internet and are reserved for research and development purposes.

How to Calculate Subnet Hosts

Calculating the number of usable hosts in a subnet is one of the most common tasks for network administrators. The formula depends on the prefix length (CIDR notation) and is straightforward once you understand the relationship between bits and addresses. The IP subnet calculator performs this calculation instantly, but knowing the manual method helps you verify results and understand your network design.

Step 1: Determine the number of host bits. For IPv4, this is 32 minus the prefix length. For example, a /26 network has 32 - 26 = 6 host bits.

Step 2: Calculate the total number of addresses using the formula 2^(host bits). For /26, that is 2^6 = 64 total addresses.

Step 3: Subtract 2 for the network address (all host bits 0) and the broadcast address (all host bits 1). This gives 64 - 2 = 62 usable host addresses.

Here is a quick reference for common prefix lengths:

CIDRSubnet MaskTotal AddressesUsable Hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

VLSM — Variable Length Subnet Masks

Variable Length Subnet Masking (VLSM) allows network administrators to use different subnet mask lengths for different subnets within the same major network. This is a significant improvement over fixed-length subnet masking (FLSM), where all subnets must use the same mask size. VLSM enables much more efficient use of IP address space by matching subnet sizes to the actual number of hosts needed in each network segment.

For example, consider a company with the 192.168.1.0/24 network that needs three subnets: one for 100 hosts, one for 50 hosts, and one for 20 hosts. With FLSM, all subnets would need a /25 mask (126 usable hosts each), wasting significant address space. With VLSM, you can allocate a /25 subnet (126 hosts) for the 100-host segment, a /26 subnet (62 hosts) for the 50-host segment, and a /27 subnet (30 hosts) for the 20-host segment — using only 218 of 256 available addresses.

The IP subnet calculator supports VLSM by allowing you to quickly test different prefix lengths for any given IP address. By experimenting with different subnet masks, you can plan your VLSM scheme efficiently and verify that your subnets do not overlap. Proper VLSM design requires careful planning to avoid overlapping address ranges, and the calculator's subnet table view helps visualize how different subnets fit within the overall address space.

Common Subnet Sizes Reference

Having a reference for common subnet sizes helps network professionals quickly identify the appropriate prefix length for different scenarios. The IP subnet calculator makes it easy to look up any prefix length, but memorizing the most commonly used sizes speeds up network design and troubleshooting. Here is a comprehensive reference table for IPv4 subnet sizes from /8 to /30:

CIDRSubnet MaskTotal IPsUsable HostsCommon Use
/8255.0.0.016,777,21616,777,214Very large networks
/16255.255.0.065,53665,534Large organizations
/24255.255.255.0256254Standard LAN
/25255.255.255.128128126Small office
/26255.255.255.1926462Small department
/27255.255.255.2243230Workgroup
/28255.255.255.2401614Small workgroup
/29255.255.255.24886Router links
/30255.255.255.25242Point-to-point links
/32255.255.255.25511Single host

For IPv6, the recommended subnet size for most local networks is /64, which provides 2^64 addresses — more than enough for any practical network. The /64 recommendation ensures compatibility with SLAAC and other IPv6 features such as privacy extensions and temporary address generation. Larger organizations might receive a /48 or /56 prefix from their ISP, allowing them to create many /64 subnets for different segments of their network infrastructure while maintaining efficient routing table aggregation.

Binary Basics for Subnetting

Understanding binary arithmetic is fundamental to mastering subnetting because all IP addresses and subnet masks are ultimately binary numbers at their core. The IP subnet calculator displays the binary representation of the subnet mask, helping you build the mental connection between the dotted-decimal format you configure on devices and the binary operations performed by network hardware.

An IPv4 address is a 32-bit binary number. Each octet (8 bits) corresponds to one decimal number in the dotted-decimal format. The binary place values within each octet are 128, 64, 32, 16, 8, 4, 2, and 1. For example, the decimal value 192 in binary is 11000000 (128 + 64), and 168 is 10101000 (128 + 32 + 8). The subnet calculator shows this conversion for every address you enter, displaying both the full 32-bit binary form and the individual octet breakdown for easy reference.

The core subnetting operation is the bitwise AND between the IP address and subnet mask. In binary AND, the result is 1 only if both bits are 1. This operation zeros out the host bits, leaving only the network address. Similarly, the bitwise OR with the inverted subnet mask produces the broadcast address by setting all host bits to 1. The calculator performs these operations instantly, but understanding them at the binary level is essential for CCNA and other networking certification exams.

Practice converting small decimal numbers to binary mentally to speed up your subnetting skills. For example, 192 in binary is 11000000, 224 is 11100000, 240 is 11110000, 248 is 11111000, 252 is 11111100, and 254 is 11111110. These are the most common non-zero octet values in subnet masks and appear frequently in network configurations. Once you recognize these patterns, you can quickly determine the prefix length just by looking at the subnet mask, without needing to convert each octet. The subnet calculator reinforces this learning by displaying both formats side by side in every result.

Common Subnetting Mistakes to Avoid

Even experienced network administrators make mistakes when designing and configuring subnets. The IP subnet calculator helps catch many of these errors before they cause network problems, but understanding the common pitfalls is the best prevention. Here are the most frequent subnetting mistakes:

Final Thoughts

The IP subnet calculator is an essential tool for anyone working with computer networks, from students studying for networking certifications to experienced administrators managing large-scale enterprise infrastructure. By providing instant, accurate subnet information for both IPv4 and IPv6 addressing schemes, this calculator eliminates manual calculation errors and speeds up network design and troubleshooting significantly.

Whether you are calculating subnet masks for a home lab, planning a VLSM scheme for a corporate network, or verifying IPv6 prefix allocations, this tool gives you the information you need in a clear, organized format. The binary, hex, integer, and reverse DNS outputs are particularly valuable for advanced networking tasks like configuring access control lists, setting up reverse DNS zones, and debugging packet captures.

This IP subnet calculator is completely free to use, requires no registration, and works on all devices. Bookmark this page for quick access during your daily network administration tasks, whether you are configuring a new router, setting up a VLAN, troubleshooting a connectivity issue, or studying for a certification exam. The ability to quickly reference subnet information without manual calculation saves time and reduces configuration errors that can lead to network outages.

For complementary tools, explore our binary calculator, hex calculator, and conversion calculator to handle other number system conversions you may need in your networking work. Together, these tools provide a complete toolkit for anyone working with IP addressing, subnetting, and network infrastructure management in both IPv4 and IPv6 environments.

To learn more about ip subnet calculator, visit NOAA.

Frequently Asked Questions

What is a subnet mask?

A subnet mask is a 32-bit number that divides an IP address into network address and host address portions. It is expressed in dot-decimal notation, such as 255.255.255.0 for a /24 subnet.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation expresses the subnet mask as a slash followed by the number of network bits. For example, /24 means the first 24 bits are the network prefix.

How many usable hosts in a /24 subnet?

A /24 subnet has 256 total IP addresses, with 254 usable for hosts after subtracting the network address and broadcast address. This is one of the most common subnet sizes used in local networks.

What is the difference between IPv4 and IPv6?

IPv4 uses 32-bit addresses with about 4.3 billion possible addresses, while IPv6 uses 128-bit addresses providing virtually unlimited addresses. IPv6 was developed to address IPv4 exhaustion.

What is a network address?

The network address is the first address in a subnet range and identifies the network itself. It is calculated by performing a bitwise AND between the IP address and the subnet mask.

What is the broadcast address?

The broadcast address is the last address in a subnet range and is used to send data to all hosts on the network. It is calculated by setting all host bits to 1 in the network address.

How do I calculate the number of hosts in a subnet?

The formula is 2^(32 - prefix_length) for IPv4. Subtract 2 from the result for the network and broadcast addresses to get usable hosts. For example, /24 gives 2^(32-24) = 256 addresses, 254 usable.

What are private IP addresses?

Private IP addresses are reserved ranges used within local networks: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These addresses are not routable on the public internet.

What does /64 mean in IPv6?

A /64 prefix in IPv6 means the first 64 bits are the network prefix, leaving 64 bits for host addresses. This is the smallest recommended subnet size and provides 2^64 addresses.

What is VLSM?

VLSM (Variable Length Subnet Mask) allows using different subnet mask lengths for different subnets within the same network, enabling more efficient IP address allocation by matching subnet sizes to actual needs.

How do I find my subnet mask?

On Windows, run ipconfig in Command Prompt. On Mac or Linux, run ifconfig or ip addr in the terminal. The subnet mask appears next to your IP address in the output.

What is the loopback address?

The loopback address 127.0.0.1 (IPv4) or ::1 (IPv6) is used to test network software on the local machine without sending packets over the network. It always refers to the local device.

Advertisement
970x250 or 728x90 Ad Space