Home Back

Calculate Netmask

Netmask Calculation:

\[ Netmask = 255.255.255.255 - (2^{(32 - CIDR)} - 1) \]

/

Unit Converter ▲

Unit Converter ▼

From: To:

1. What is Netmask?

A netmask is a 32-bit number that divides an IP address into network and host portions. It's used to determine which part of an IP address belongs to the network and which part belongs to the host.

2. How Does the Calculator Work?

The calculator uses the following formula:

\[ Netmask = 255.255.255.255 - (2^{(32 - CIDR)} - 1) \]

Where:

3. Importance of Netmask Calculation

Details: Netmasks are essential for network configuration, routing, and determining the size of a subnet. They help in dividing networks into smaller sub-networks (subnets).

4. Using the Calculator

Tips: Enter the CIDR notation (e.g., 24 for /24). The value must be between 0 and 32. The calculator will output the corresponding netmask in dotted-decimal notation.

5. Frequently Asked Questions (FAQ)

Q1: What is CIDR notation?
A: CIDR (Classless Inter-Domain Routing) notation represents an IP address and its routing prefix in the format like /24, where the number indicates the number of network bits.

Q2: What are common netmask values?
A: Common values include 255.255.255.0 (/24), 255.255.0.0 (/16), and 255.0.0.0 (/8).

Q3: Can I calculate the inverse (CIDR from netmask)?
A: Yes, by counting the number of consecutive 1 bits in the netmask's binary representation.

Q4: Why do we subtract from 255.255.255.255?
A: This operation effectively sets all host bits to 0 while keeping network bits as 1.

Q5: What's the difference between netmask and wildcard mask?
A: Wildcard mask is the inverse of netmask, used in access control lists and routing protocols.

Calculate Netmask© - All Rights Reserved 2025