IP Subnet Calculator - CalcVenue

IP Subnet Calculator

IPv4 Subnet Calculator

Network Class

IPv6 Subnet Calculator

What Is an IP Subnet Calculator?

An IP subnet calculator is a tool that computes the key properties of an IP network segment from an IP address and a subnet prefix. Enter any valid IPv4 address and a CIDR prefix length (such as 192.168.1.0/24), and the calculator instantly returns the network address, broadcast address, usable host IP range, subnet mask, wildcard mask, binary subnet mask, IP class, total host count, usable host count, and several other identifiers. Our calculator also supports IPv6, handling all 128-bit addressing and prefix lengths from /1 to /128.

Network engineers, system administrators, students studying for networking certifications (CCNA, CompTIA Network+, Security+), and anyone designing or troubleshooting IP networks rely on an IP subnet calculator daily. Understanding subnetting is foundational to all TCP/IP networking - from configuring a home router to architecting enterprise data center networks.

What Is an IP Address?

An IP address (Internet Protocol address) is a unique numerical label assigned to every device connected to a network that uses the Internet Protocol for communication. IP addresses serve two core functions: host identification (identifying a specific device) and location addressing (providing the network location of that device so packets can be routed to it).

IPv4 Address Structure

An IPv4 address is a 32-bit number, conventionally written as four decimal octets separated by dots - called dotted-decimal notation. Each octet represents 8 bits and ranges from 0 to 255.

Example: 192.168.10.25

In binary, this is: 11000000.10101000.00001010.00011001

Every IPv4 address consists of two parts:

  • Network portion: Identifies which network (subnet) the device belongs to. All devices on the same subnet share the same network portion.
  • Host portion: Identifies the specific device within that network. Must be unique within the subnet.

The subnet mask determines where the boundary between the network and host portions falls.

What Is a Subnet?

A subnet (subnetwork) is a logically visible subdivision of an IP network. Subnetting is the process of dividing a larger network into smaller, more manageable segments. Each subnet acts as its own isolated broadcast domain - traffic broadcast within one subnet does not propagate to other subnets unless a router explicitly forwards it.

Subnets are separated by routers, which serve as the physical and logical boundaries between networks. When a device in Subnet A needs to communicate with a device in Subnet B, the packet must pass through a router that has interfaces on both subnets and knows the routing paths between them.

Why Subnet?

Subnetting provides several critical benefits:

  • Improved security: Devices in separate subnets cannot communicate directly without passing through a router or firewall, enabling granular access control policies.
  • Reduced broadcast traffic: Broadcasts are contained within their subnet. Fewer devices in a subnet means each device sees fewer broadcasts, improving performance.
  • Efficient IP address use: Allocating exactly the right subnet size for each segment (a /29 for a 6-device office, a /24 for a 200-device campus floor) minimizes wasted address space.
  • Logical network organization: Subnets can map to physical locations, departments, or functions (HR subnet, Finance subnet, Guest WiFi subnet), making network management cleaner.
  • Fault isolation: Problems in one subnet - excessive broadcasts, a rogue device - are contained and don't affect the entire network.

CIDR Notation Explained

CIDR stands for Classless Inter-Domain Routing. Introduced in 1993 (RFC 1519) to replace the rigid classful addressing system, CIDR allows network prefixes of any length from /1 to /32 for IPv4, dramatically reducing address waste and routing table bloat.

CIDR notation expresses an IP address and its subnet prefix together: IP address / prefix length. The prefix length (the number after the slash) indicates how many of the 32 bits are the network portion. The remaining bits are the host portion.

Example: 192.168.1.0/24 means the first 24 bits (192.168.1) identify the network, and the last 8 bits (.0 to .255) identify hosts within it. This gives 2⁸ = 256 total addresses, 254 of which are usable by hosts.

Every additional bit added to the prefix halves the number of hosts and doubles the number of subnets you can create from a given block:

  • /24 → 256 addresses, 254 usable hosts
  • /25 → 128 addresses, 126 usable hosts (splits /24 into 2 subnets)
  • /26 → 64 addresses, 62 usable hosts (splits /24 into 4 subnets)
  • /27 → 32 addresses, 30 usable hosts (splits /24 into 8 subnets)
  • /28 → 16 addresses, 14 usable hosts (splits /24 into 16 subnets)
  • /30 → 4 addresses, 2 usable hosts (common for point-to-point links)

Subnet Mask Explained

A subnet mask is a 32-bit number that separates the network portion of an IP address from the host portion. When written in dotted-decimal notation, a subnet mask looks like an IP address - but it always consists of a continuous block of 1s followed by a continuous block of 0s in binary.

CIDRSubnet MaskBinary
/8255.0.0.011111111.00000000.00000000.00000000
/16255.255.0.011111111.11111111.00000000.00000000
/24255.255.255.011111111.11111111.11111111.00000000
/25255.255.255.12811111111.11111111.11111111.10000000
/26255.255.255.19211111111.11111111.11111111.11000000
/28255.255.255.24011111111.11111111.11111111.11110000
/30255.255.255.25211111111.11111111.11111111.11111100

To find the network address, perform a bitwise AND between the IP address and the subnet mask. To find the broadcast address, perform a bitwise OR between the network address and the wildcard mask (the bitwise complement of the subnet mask).

Key Subnet Properties

  • Network Address: The first address in the subnet - identifies the subnet itself and is not assignable to any host. Calculated by performing a bitwise AND between the IP address and the subnet mask.
  • Broadcast Address: The last address in the subnet - used to send data simultaneously to all hosts in the subnet. No host can be assigned this address. Calculated by setting all host bits to 1.
  • Usable Host Range: All addresses between the network address and broadcast address (exclusive). Total hosts minus 2. For a /24 subnet: 192.168.1.1 through 192.168.1.254.
  • Wildcard Mask: The bitwise inverse of the subnet mask. A /24 subnet mask of 255.255.255.0 has a wildcard mask of 0.0.0.255. Wildcard masks are used in Cisco access control lists (ACLs), OSPF network statements, and firewall rules.
  • Binary Subnet Mask: The subnet mask written in full binary (32 bits, grouped in octets). Useful for understanding exactly which bits are the network portion versus the host portion.
  • IP Class: The legacy classful classification (A, B, C) of the IP address based on its first octet. Largely superseded by CIDR but still referenced in many contexts.
  • IP Type: Whether the address is public, private, loopback, APIPA/link-local, multicast, or reserved.

IP Address Classes (IPv4)

Before CIDR was introduced, IPv4 addresses were divided into classes based on the first few bits of the address. Each class defined a default subnet mask, which in turn determined how many networks and hosts were available. While CIDR has largely replaced classful addressing in modern routing, understanding classes remains important for networking fundamentals and certification exams.

ClassFirst Octet RangeDefault MaskNetworksHosts per Network
A1 – 126255.0.0.0 (/8)12616,777,214
B128 – 191255.255.0.0 (/16)16,38465,534
C192 – 223255.255.255.0 (/24)2,097,152254
D224 – 239N/AMulticast (reserved)
E240 – 255N/AExperimental (reserved)

Note: 127.x.x.x is reserved for loopback (localhost) and is not part of Class A. The address 0.0.0.0 is reserved for the default network.

Private IP Address Ranges

RFC 1918 defines three blocks of IPv4 addresses reserved for private (non-routable) use on internal networks. These addresses cannot be used on the public internet and are translated to public IPs via Network Address Translation (NAT) when devices need to access the internet.

RangeCIDR BlockClassTotal Addresses
10.0.0.0 – 10.255.255.25510.0.0.0/8A16,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/12B1,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/16C65,536

Other special-purpose address ranges include:

  • 127.0.0.0/8: Loopback - traffic to these addresses stays on the local device. 127.0.0.1 is "localhost."
  • 169.254.0.0/16: APIPA (Automatic Private IP Addressing) / Link-local - assigned automatically when a DHCP server is unreachable. Indicates a network configuration problem on most hosts.
  • 0.0.0.0/8: Reserved; often used to mean "this network" or "any address."
  • 255.255.255.255: Limited broadcast address - sends to all hosts on the local network without routing.

Worked Subnetting Example

Let's subnet the address 192.168.5.130/26 step by step - the same calculation our IP subnet calculator performs instantly.

Step 1 - Convert prefix to subnet mask: /26 means 26 network bits. In binary: 11111111.11111111.11111111.11000000 = 255.255.255.192

Step 2 - Find the network address (bitwise AND of IP and mask):
192.168.5.130 = 11000000.10101000.00000101.10000010
255.255.255.192 = 11111111.11111111.11111111.11000000
AND result: 11000000.10101000.00000101.10000000 = 192.168.5.128

Step 3 - Find the wildcard mask (inverse of subnet mask):
~255.255.255.192 = 0.0.0.63

Step 4 - Find the broadcast address (network address OR wildcard mask):
192.168.5.128 | 0.0.0.63 = 192.168.5.191

Step 5 - Find usable host range:
First host: 192.168.5.129 (network address + 1)
Last host: 192.168.5.190 (broadcast − 1)
Usable hosts: 2⁶ − 2 = 64 − 2 = 62 hosts

IPv4 Subnet Reference Table

The table below lists every possible IPv4 prefix length with its corresponding subnet mask, total address count, and usable host count. Use this as a quick reference when designing network segments.

CIDRSubnet MaskTotal HostsUsable Hosts

VLSM - Variable Length Subnet Masking

Variable Length Subnet Masking (VLSM) is the practice of using different subnet mask sizes within the same network - allocating subnets of exactly the right size for each segment rather than using a uniform mask everywhere. VLSM is a cornerstone of efficient IP address planning in any organization with multiple network segments of different sizes.

Example scenario: You have the block 10.1.0.0/24 and need to accommodate:

  • Department A: 100 hosts → assign 10.1.0.0/25 (126 usable hosts)
  • Department B: 50 hosts → assign 10.1.0.128/26 (62 usable hosts)
  • Department C: 25 hosts → assign 10.1.0.192/27 (30 usable hosts)
  • Point-to-point WAN link → assign 10.1.0.224/30 (2 usable hosts)

With VLSM, all 256 addresses in the /24 are allocated efficiently with minimal waste. Without VLSM (using a uniform /25 for all segments), you would only fit two segments in the /24, wasting the space that could serve Departments C and the WAN link.

IPv6 Subnetting

IPv6 addresses are 128 bits long (versus IPv4's 32 bits), written as eight groups of four hexadecimal digits separated by colons. The total IPv6 address space is 2¹²⁸ - approximately 340 undecillion addresses - making address exhaustion effectively impossible at any foreseeable scale.

IPv6 uses the same CIDR prefix notation as IPv4. Key IPv6 subnetting conventions:

  • /48: The standard prefix assigned to an organization by an ISP. Provides 2⁸⁰ addresses and allows subnetting into 65,536 /64 networks.
  • /56: A smaller ISP allocation for residential customers or smaller organizations. Provides 256 /64 subnets.
  • /64: The standard prefix for a single network segment (LAN). All auto-configuration (SLAAC) and many routing protocols assume a /64. Provides 2⁶⁴ ≈ 18.4 quintillion addresses per subnet.
  • /128: A single host address, equivalent to IPv4's /32.

Unlike IPv4, IPv6 has no broadcast addresses - it uses multicast instead. All addresses in an IPv6 /64 subnet are usable by hosts. The reserved addresses are the all-zeros network address and specific multicast addresses defined by the protocol, not blocked from use in the way IPv4 reserves network and broadcast addresses.

Special IPv6 Address Types

  • ::1/128: Loopback address (equivalent to IPv4's 127.0.0.1)
  • ::/128: Unspecified address (used by devices before they have an address)
  • fe80::/10: Link-local unicast (automatically configured on every IPv6 interface, not routable)
  • fc00::/7: Unique local addresses (IPv6 equivalent of RFC 1918 private ranges)
  • ff00::/8: Multicast
  • 2000::/3: Global unicast (routable on the public internet)

How to Use the IP Subnet Calculator

IPv4 Calculator

Select the Network Class filter (Any, A, B, or C) to limit the CIDR dropdown to prefixes appropriate for that class. Then choose your subnet prefix from the dropdown (which shows both the subnet mask and CIDR notation) and enter your IPv4 address in the text field. Click Calculate to see all subnet properties. The result includes the network address, usable host range, broadcast address, total and usable host counts, subnet mask, wildcard mask, binary mask, IP class, CIDR notation, IP type (public/private/loopback/etc.), binary representation, integer and hexadecimal IDs, in-addr.arpa reverse DNS notation, IPv4-mapped IPv6 address, and 6to4 transition prefix.

IPv6 Calculator

Enter any valid IPv6 address in standard or compressed notation (e.g., 2001:db8::1 or 2001:0db8:0000:0000:0000:0000:0000:0001). Select a prefix length from /1 to /128. The calculator returns the full expanded address, compressed short form, network address, usable host range, total address count, and IPv6 address type.

Frequently Asked Questions

What is a /24 subnet?

A /24 subnet uses a subnet mask of 255.255.255.0. It contains 256 total addresses (2⁸) - 254 of which are usable by hosts (the network address and broadcast address are reserved). It is the most common subnet for home networks, small office networks, and individual VLAN segments, as it neatly aligns with the third octet of the IP address. For example, 192.168.1.0/24 covers 192.168.1.0 (network) through 192.168.1.255 (broadcast), with hosts using 192.168.1.1–192.168.1.254.

What are private IP address ranges?

RFC 1918 defines three private (non-internet-routable) IPv4 ranges: 10.0.0.0/8 (Class A, 16.7 million addresses), 172.16.0.0/12 (Class B range, 1 million addresses), and 192.168.0.0/16 (Class C range, 65,536 addresses). Devices using private IPs access the internet through NAT (Network Address Translation), where a router translates private IPs to a single public IP. This is why millions of home networks can all use 192.168.1.x without conflict - those addresses never appear on the public internet.

What is the difference between /30 and /31 subnets?

A /30 subnet contains 4 addresses: 1 network address, 2 usable host addresses, and 1 broadcast address. It has historically been the standard for point-to-point WAN links (router-to-router connections requiring exactly 2 IP addresses). A /31 subnet contains only 2 addresses. Normally this would leave 0 usable hosts (both reserved for network and broadcast), but RFC 3021 (2000) allows both addresses to be used as host addresses for point-to-point links, eliminating the overhead of the reserved addresses. Both /30 and /31 work for point-to-point links; /31 is more address-efficient but not supported by all older network equipment.

How many usable hosts does a /27 subnet have?

A /27 subnet has 32 total addresses (2⁵ = 32) and 30 usable host addresses (32 − 2 = 30, subtracting the network and broadcast addresses). The subnet mask is 255.255.255.224. A /24 block can be divided into exactly 8 /27 subnets, each supporting up to 30 hosts - useful for departments or network segments that need between 15 and 30 devices.

What is the wildcard mask used for?

The wildcard mask is the bitwise inverse of the subnet mask. A /24 subnet mask of 255.255.255.0 has a wildcard mask of 0.0.0.255. Wildcard masks are used in three main contexts: Cisco router access control lists (ACLs) to specify which IP addresses a rule applies to, OSPF network statements to define which interfaces participate in the routing protocol, and some firewall rule engines. A "0" bit in a wildcard mask means "this bit must match exactly"; a "1" bit means "this bit can be anything." So a wildcard mask of 0.0.0.255 means "match the first three octets exactly, and allow any value in the fourth."

Why does IPv6 use /64 for almost everything?

The /64 boundary is technically mandated by IPv6's Stateless Address Autoconfiguration (SLAAC, defined in RFC 4862). SLAAC uses the 64-bit EUI-64 format (derived from a device's MAC address) to automatically generate the host portion of an IPv6 address. Because this algorithm requires exactly 64 host bits, subnets smaller than /64 cannot support SLAAC - which is why virtually every IPv6 end-user segment uses /64 regardless of how few devices it will contain. The effectively inexhaustible IPv6 address space makes this wastage irrelevant in practice.

What does "in-addr.arpa" mean in the results?

The in-addr.arpa notation is used for IPv4 reverse DNS lookups - finding the hostname associated with an IP address rather than the IP address for a hostname. Reverse DNS is stored in the in-addr.arpa DNS zone, with the octets of the IP address reversed. For the IP 192.168.1.50, the reverse DNS record would be found at 50.1.168.192.in-addr.arpa. Network administrators configure PTR records in this zone so that tools like traceroute and mail server verification can resolve IPs back to hostnames.