Subnet Mask Calculator – Accurate IPv4 & IPv6 Network Calculation Tool

Last Updated : 11 Mar, 2026

A Subnet Mask Calculator is a powerful tool for network administrators and IT professionals that simplifies IP subnetting.

Steps to Use the Subnet Mask Calculator

Step 1: Enter an IP Address

  • Input a valid IPv4 (e.g., 192.168.1.1) or IPv6 (e.g., 2001:db8::1) address into the designated field.

Step 2: Choose a Subnet Mask or CIDR Notation

  • Select a subnet mask from the dropdown menu (e.g., 255.255.255.0).
  • Alternatively, you can type a CIDR range (e.g., /24 ) to define how many bits are used for the network portion.

Step 3: View Results in Real-Time
The calculator displays:

  • IPv4: Network address, broadcast address, host range, subnet mask, wildcard mask, total and usable hosts, IP class, and public/private scope.
  • IPv6: Prefix address, address range, total IPs, and scope (Global or Link-local).
  • Binary view: Shows IP and subnet mask in binary for IPv4.

Step 4: Explore Additional Features
Use the detailed results toggle for a full technical breakdown, check the quick summary cards for key information, or copy all results with the “COPY ALL” button.

Note: Experiment with different IPs and subnet masks to see how it affects the network range.

Key Features of Subnet Mask Calculator

Here are some features of our subnet mask calculator:

  • Supports both IPv4 and IPv6 subnet calculations
  • Full CIDR notation support with automatic mask generation
  • Calculates network address, broadcast address, and host range (IPv4)
  • Displays usable hosts and total IPs for accurate network planning
  • Identifies IP class (A, B, C, D/E) and public/private scope
  • Provides IPv6 prefix address, range, and scope detection
  • Includes binary representation of IPv4 address and subnet mask
  • Real-time results with instant updates on input change
  • Detailed results toggle with copy-to-clipboard option
  • Clean, responsive UI with quick summary cards.

Subnet Mask

subnet mask defines the division between the network and host portions of an IP address. It ensures efficient IP address management by breaking large networks into smaller, manageable subnets, which helps reduce network congestion and improves security.

To more about subnetting, you can refer here.

For Example:

  • A 255.255.255.0 subnet mask (or /24 in CIDR ) provides 256 IP addresses (254 usable).
  • A 255.255.0.0 mask (or /16 ) provides 65,536 IP addresses .

Subnet Mask Calculator for IPv4 and IPv6 Networks

IPv4 Subnetting

IPv4 uses 32-bit addresses, often represented in dotted-decimal notation. Subnetting helps split these IP addresses into smaller networks. For example:

  • Class A : 0.0.0.0 – 127.255.255.255
  • Class B : 128.0.0.0 – 191.255.255.255
  • Class C : 192.0.0.0 – 223.255.255.255

The calculator shows detailed results for each subnet, including:

  • Network Address : The starting address of the subnet.
  • Broadcast Address: The last address in the subnet.
  • Usable IPs: Available IPs for assigning to devices.

IPv6 Subnetting

IPv6 uses 128-bit addresses and eliminates the need for network classes. Instead, IPv6 relies on CIDR notation for subnetting. The subnet calculator supports IPv6-specific calculations, providing:

  • Network Prefix : The starting point of the IPv6 subnet.
  • Address Range : Usable IPv6 addresses in a given prefix.
  • Abbreviated Addressing : Simplified IPv6 address formats.

CIDR Notation and Subnet Masks Explained

CIDR notation, such as /24, represents the number of bits used for the network part of the address. Here are some common subnet masks with their CIDR equivalents:

CIDR NotationSubnet MaskHosts per Subnet
/8255.0.0.016,777,214
/16255.255.0.065,534
/24255.255.255.0254
/30255.255.255.2522

Steps to Calculate a Subnet Mask

Let's calculate the subnet mask for 192.168.1.0/26.

Step 1: Identify the CIDR Notation (Prefix Length)

In this example, /26 means the first 26 bits are for the network portion, and the remaining bits are for hosts.

Step 2: Convert the CIDR to Binary Subnet Mask

Write the first 26 bits as 1s (for the network) and the remaining 6 bits as 0s (for hosts):

11111111.11111111.11111111.11000000

Step 3: Convert the Binary to Decimal

  • Convert each 8-bit block to decimal:
    11111111 = 255
    11111111 = 255
    11111111 = 255
    11000000 = 192
  • So, thesubnet mask is 255.255.255.192 .

Step 4: Calculate the Number of Usable Hosts

  • Subtract the network and broadcast addresses (2 addresses) from the total hosts.
  • Formula: 232−26−2=62232−26−2=62 usable IPs.

Step 5: Find the IP Range

  • Network Address : 192.168.1.0
  • Broadcast Address : 192.168.1.63
  • Usable IP Range : 192.168.1.1 to 192.168.1.62
Comment