Subnet Mask & CIDR IP Range Calculator
Network Engineering Tool

Subnet Mask & CIDR IP Range Calculator

Convert between CIDR notation and subnet masks, calculate IP ranges, broadcast addresses, usable hosts, and split networks into smaller subnets — all in real time.

IP Address & CIDR Input

Quick CIDR: /8 /16 /20 /22 /24 /25 /26 /28 /30 /32

CIDR Reference Table

Click any row to load it into the calculator above.
CIDRSubnet MaskWildcardNetwork BitsHost BitsTotal IPsUsable HostsClass
Quick notes: /31 networks are used for point-to-point links (RFC 3021) and support 2 usable hosts without broadcast. /32 represents a single host (loopback / dedicated address).
Copied!

Subnet Mask & CIDR IP Range Calculator

If you have ever tried to configure a home router, set up a cloud server, or study for a network certification like the CCNA, you already know that IP math can be a massive headache. Manually converting IP addresses to binary, counting bits, and figuring out broadcast domains is tedious and highly prone to errors.

 

That is exactly why we built the Subnet Mask & CIDR IP Range Calculator. This free, intuitive tool does the heavy lifting for you. Whether you are dividing a large corporate network into smaller VLANs or simply trying to figure out if two computers belong on the same local network, this calculator gives you the answers in milliseconds.

 

In this comprehensive guide, we will explain everything you need to know about subnetting, CIDR notation, and how to get the absolute most out of this tool.

 

What is a Subnet Mask & CIDR?

To understand the calculator, we first need to understand the two concepts it is named after: Subnet Masks and CIDR (Classless Inter-Domain Routing).

 

The Definition and Purpose

Every device connected to an IP network has an IP address. An IP address is actually made of two parts: the network portion (which identifies the specific network segment) and the host portion (which identifies the specific device on that segment).

 

A subnet mask is a 32-bit number that acts as a divider. It tells devices where the network portion ends and the host portion begins. Traditionally, subnet masks were written out in decimal format, like 255.255.255.0.

 

In 1993, to prevent the internet from running out of IP addresses, a new system called CIDR was introduced. CIDR allows networks to be divided into much more flexible sizes, rather than the strict, rigid “Classes” (A, B, and C) used previously.

 

Background and Importance

Before CIDR, if you needed 300 IP addresses for your business, you were given an entire Class B network block, which contains 65,536 addresses. Over 65,000 addresses were completely wasted! CIDR solved this by allowing network administrators to borrow bits from the host portion and assign them to the network portion.

 

Today, CIDR notation is the global standard. It is written as an IP address followed by a slash and a number, like this: 192.168.1.0/24. The /24 is the CIDR prefix, which simply means the first 24 bits of the IP address represent the network.

 

How This Calculator Works

Our Subnet Mask & CIDR IP Range Calculator takes the complex bitwise math of IPv4 networking and automates it entirely.

 

The Inputs

  1. IPv4 Address: Any valid IPv4 address (e.g., 192.168.1.100). This is the address you want to analyze.
  2. CIDR Notation (Prefix Length): A number between 0 and 32 (e.g., 24). You can type this in or use our quick-select chips.
 

The Outputs

The calculator instantly provides a complete network profile:

  • Network Address: The lowest IP in the block (used to identify the network itself).
  • Broadcast Address: The highest IP in the block (used to send data to all devices on that network).
  • Usable Host Range: The first and last IP addresses that can be assigned to actual computers or devices.
  • Subnet Mask: The decimal representation of the CIDR prefix (e.g., 255.255.255.0).
  • Wildcard Mask: The inverse of the subnet mask, primarily used in firewall and routing rules (e.g., 0.0.0.255).
  • Total IPs and Usable Hosts: The mathematical capacity of the subnet.
  • Binary Visualization: A color-coded diagram showing exactly which bits belong to the network and which belong to the hosts.
 

Step-by-Step Calculation Process

When you click “Calculate,” the tool performs the following operations in the background:

  1. Converts your IP address into a 32-bit binary string.
  2. Generates the subnet mask by creating 1s for the CIDR length and 0s for the remaining bits.
  3. Performs a Bitwise AND operation between the IP and the Mask to find the Network Address.
  4. Generates the Wildcard Mask by inverting the subnet mask (Bitwise NOT).
  5. Performs a Bitwise OR operation between the Network Address and the Wildcard Mask to find the Broadcast Address.
  6. Calculates the first usable host (Network + 1) and last usable host (Broadcast – 1).
 

The Math Behind Subnetting: Formula Explained

If you are studying for an IT certification or just curious about how the internet works, understanding the underlying math is crucial.

 

The Core Formulas

1. Subnet Mask Formula: Mask =

(In simpler terms: write 1 CIDR times, followed by 0s until you reach 32 bits).

 

2. Network Address Formula: Network = IP Address AND Subnet Mask (In binary, compare the IP and Mask bit-by-bit. If both are 1, the result is 1. Otherwise, 0).

 

3. Broadcast Address Formula: Broadcast = Network Address OR Wildcard Mask (In binary, if either bit is 1, the result is 1).

 

4. Total IP Addresses Formula: Total IPs =

5. Usable Hosts Formula: Usable Hosts = Total IPs – 2 (We subtract 2 because the very first IP is the Network Address and the very last IP is the Broadcast Address. Neither can be assigned to a device).

 

Example Calculation

Let’s calculate 10.0.5.50/22 manually:

 
  1. IP Binary: 00001010.00000000.00000101.00110010
  2. Mask (/22): 11111111.11111111.11111100.00000000 (Decimal: 255.255.252.0)
  3. Network (AND): 00001010.00000000.00000100.00000000 (Decimal: 10.0.4.0)
  4. Wildcard: 00000000.00000000.00000011.11111111 (Decimal: 0.0.3.255)
  5. Broadcast (OR): 00001010.00000000.00000111.11111111 (Decimal: 10.0.7.255)
  6. Usable Range: 10.0.4.1 to 10.0.7.254
  7. Total IPs:
    8. Usable Hosts:
 

Common Mathematical Mistakes

  • Forgetting to subtract 2: Many beginners mistakenly think a /24 network has 256 usable hosts. It actually has 254.
  • Crossing octet boundaries: In the /22 example above, the network spans across the third octet boundary (from 4 to 7). Doing this math in your head is incredibly difficult without a subnet calculator.
 
 

💡 Pro Tip: If you need to brush up on your binary math, try using our Binary to Decimal Converter to see how each octet translates from 1s and 0s into standard numbers.


How to Use the Calculator

Using this tool requires zero networking experience. Follow these simple steps:

 
  1. Enter the IP Address: In the “IPv4 Address” field, type the IP you want to analyze (e.g., 192.168.1.100).
  2. Enter the CIDR: In the “CIDR /” field, input the prefix length (from 0 to 32). Alternatively, click one of the Quick CIDR chips below the input box (like /24, /26, or /30) for instant calculations.
  3. Click Calculate: Instantly, the results grid will populate below.
  4. Review the Diagrams: Scroll down to view the color-coded binary breakdown and the visual subnet range bar. These diagrams are incredibly helpful for visual learners.
  5. Use the Subnet Splitter: Want to divide your network into smaller chunks? Select how many subnets you need (2, 4, 8, etc.) and the tool will generate a detailed table of the new subnets.
  6. Copy Results: Click on any result card (like the Network Address or Broadcast Address) to instantly copy the value to your clipboard.
 

Example Calculations

To give you a clear idea of how this tool works in various scenarios, let’s look at three practical examples.

 

Example 1: Standard Home Network (Beginner)

Most home routers use a /24 network.

 
  • Input IP: 192.168.1.50
  • CIDR: /24
  • Results:
    • Network Address: 192.168.1.0
    • Broadcast Address: 192.168.1.255
    • Usable Hosts: 254 (192.168.1.1 to 192.168.1.254)
    • Subnet Mask: 255.255.255.0
 

Example 2: Point-to-Point Router Link (Advanced)

ISPs and enterprises use /30 networks to connect two routers, saving IP space.

 
  • Input IP: 10.10.10.5
  • CIDR: /30
  • Results:
    • Network Address: 10.10.10.4
    • Broadcast Address: 10.10.10.7
    • Usable Hosts: 2 (10.10.10.5 and 10.10.10.6)
    • Subnet Mask: 255.255.255.252
 

Example 3: Splitting a Network (Expert)

Imagine you are given 172.16.0.0/22 and need to split it evenly among 4 different office departments.

 

Using the Subnet Splitter feature:

  • Input IP: 172.16.0.0
  • CIDR: /22
  • Split Count: 4 Subnets
 

The calculator instantly generates the following table:

 
Subnet #
Network
First Host
Last Host
Broadcast
1172.16.0.0/24172.16.0.1172.16.0.254172.16.0.255
2172.16.1.0/24172.16.1.1172.16.1.254172.16.1.255
3172.16.2.0/24172.16.2.1172.16.2.254172.16.2.255
4172.16.3.0/24172.16.3.1172.16.3.254172.16.3.255

Benefits of Using Our Subnet Calculator

  1. Eliminates Human Error: Manual binary math is prone to mistakes. This tool guarantees 100% accuracy every time.
  2. Saves Time: What takes 5 minutes to calculate by hand takes 0.1 seconds here.
  3. Visual Learning: The binary breakdown diagram helps students visually grasp network bits versus host bits.
  4. Built-in Subnet Splitter: You don’t need a separate tool to divide large networks into smaller VLANs.
  5. Zero Installation: It runs entirely in your web browser. No downloads or software installations required.
  6. Mobile Friendly: Working on a server rack? Pull up the calculator on your phone for quick IP math.
  7. Detailed Reference Table: The built-in CIDR reference table provides a quick cheat sheet for every prefix from /0 to /32.
  8. Supports Public and Private IPs: Works flawlessly with RFC 1918 private addresses and public internet IPs.
  9. Copy-to-Clipboard: Instantly copy network addresses, wildcards, or broadcast IPs for use in your router configurations.
  10. Completely Free: Unlimited calculations with no paywalls, ads blocking the tool, or sign-up requirements.
 

Features of the Calculator

  • IPv4 & CIDR Input Grid: Simple, intuitive entry fields with quick-select chips for common prefix lengths.
  • 12-Point Results Grid: Displays Network Address, Broadcast, First/Last Usable Host, Subnet Mask, Wildcard Mask, IP Class, Total Addresses, Usable Hosts, Address Type (Public/Private), and Host Bits.
  • Binary Breakdown Diagram: A color-coded, 32-bit visual representation showing exactly how the IP and Mask interact to create the Network Address.
  • Subnet Range Visualization: A graphical slider showing the positioning of the Network, First Host, Last Host, and Broadcast addresses within the block.
  • Dynamic Subnet Splitter: Automatically calculates equally divided sub-networks with a scrollable, detailed table.
  • Click-to-Copy Interface: Streamlined workflow for network administrators and engineers.
  • Interactive CIDR Reference Table: A comprehensive table where clicking any row automatically loads that prefix into the calculator.
 

Real-World Applications

IT and Network Engineering

Network engineers use this tool daily to design VLANs, assign IP scopes to different office floors, and configure routing protocols like OSPF or BGP. It is essential for ensuring that two devices are on the same broadcast domain or calculating overlapping routes.

 

Cloud Computing (AWS, Azure, GCP)

When launching Virtual Private Clouds (VPCs) in cloud environments, you must carve out subnets for different availability zones. A subnet calculator ensures you don’t accidentally create overlapping CIDR blocks, which will break your cloud infrastructure.

 

Education and Certification

Students preparing for CompTIA Network+, Cisco CCNA, or Microsoft Azure Administrator exams use this tool to verify their manual subnetting homework and visualize the binary math behind the scenes.

 

Cybersecurity

Security analysts use subnet calculations to write precise firewall rules. Knowing the exact broadcast address and wildcard mask of a suspicious IP block helps in creating accurate Access Control Lists (ACLs) to block malicious traffic.

 

Advantages

  • Speed: Instantaneous calculations.
  • Accuracy: No floating-point math or estimation; strict 32-bit integer logic.
  • Accessibility: Transparent background and responsive design integrate beautifully into any device or screen size.
  • Educational Value: Unlike basic calculators that just spit out numbers, the diagrams here actually teach you how the math works.
 

Limitations

While this tool is highly robust, it is important to understand its current boundaries:

  • IPv4 Only: This specific calculator handles 32-bit IPv4 addressing. It does not calculate IPv6 subnets (which operate on a 128-bit scale).
  • No VLSM (Variable Length Subnet Masking): The current subnet splitter divides the network into equal sizes. It does not yet support creating subnets of varying sizes within the same parent network.
  • Not a DNS Tool: It calculates IP ranges but does not perform reverse DNS lookups or WHOIS queries.
 

Tips for Accurate Results

To ensure you get the best results from the calculator, keep these tips in mind:

  1. Use valid IPv4 formatting: Always include four octets separated by dots (e.g., 10.0.0.1, not 10.0.1).
  2. Mind the CIDR range: The prefix length must be between 0 and 32. Anything outside this range will trigger an error.
  3. Understand Special Ranges: A /31 network will show 2 usable hosts. This is not a bug; it follows RFC 3021, which allows /31 links for point-to-point router connections.
  4. Check your IP class: The calculator will tell you if an IP is Private (RFC 1918) or Public. If you are setting up a home lab, make sure you are using private ranges (10.x.x.x, 172.16.x.x – 172.31.x.x, or 192.168.x.x).
 

Common Mistakes in Subnetting

Even with a calculator, understanding these common pitfalls can save you hours of network troubleshooting:

 
  • Assigning the Network or Broadcast IP to a device: If you manually assign 192.168.1.0 or 192.168.1.255 to a computer on a /24 network, it will have connectivity issues. Always use the “Usable Host” range.
  • Overlapping Subnets: If you configure two routers with overlapping CIDR blocks (e.g., 10.0.0.0/23 and 10.0.1.0/24), packets will route incorrectly. Use our Subnet Splitter to ensure clean, non-overlapping boundaries.
  • Confusing Wildcard Masks with Subnet Masks: Firewalls like Cisco ASA or routing protocols like OSPF use wildcard masks (e.g., 0.0.0.255), which are the exact inverse of subnet masks. This calculator provides both so you don’t accidentally swap them.
 

Frequently Asked Questions (FAQs)

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation is a compact method of specifying an IP address and its routing prefix. It is written as an IP address followed by a slash and a number (e.g., 192.168.1.0/24), where the number indicates how many bits are used for the network portion.

 

How do I calculate the number of usable hosts?

To calculate usable hosts, subtract the CIDR prefix from 32 to get the host bits (e.g., 32 – 24 = 8). Raise 2 to the power of the host bits (

). Finally, subtract 2 for the network and broadcast addresses (256 – 2 = 254 usable hosts).

 

What is the difference between a subnet mask and a wildcard mask?

A subnet mask uses 1s to identify the network portion of an IP address (e.g., 255.255.255.0). A wildcard mask is the exact bitwise inverse, using 0s for the network portion and 1s for the host portion (e.g., 0.0.0.255). Wildcard masks are commonly used in Cisco ACLs.

 

Can I use this calculator for IPv6?

No, this specific tool is designed exclusively for 32-bit IPv4 addresses. IPv6 uses a 128-bit addressing scheme and requires a completely different calculation logic.

 

What does a /32 network mean?

A /32 network represents a single, isolated host. It has no network or broadcast address to subtract, meaning the total IP count is 1, and usable hosts are 1. It is often used for loopback addresses or specific firewall rules.

 

Why does a /31 show 2 usable hosts?

Historically, a /31 (which contains 2 total IPs) was considered unusable because it left no room for hosts after network and broadcast addresses. However, RFC 3021 allows /31 networks to be used for point-to-point router links, treating both IPs as usable hosts to conserve address space. Our calculator supports this standard.

 

How do I find the broadcast address?

The broadcast address is the highest IP address in a subnet. Mathematically, it is found by performing a Bitwise OR operation between the Network Address and the Wildcard Mask. You can also just look at the “Broadcast Address” field in our calculator!

 

What are private IP addresses?

Private IP addresses are ranges reserved for internal networks by RFC 1918. They include 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 and are used in homes and businesses. Our calculator flags whether an IP is private or public.

 

How do I split a large network into smaller subnets?

You can use the “Subnet Splitter” feature on this page. Enter your starting network and CIDR, choose how many subnets you want (2, 4, 8, 16, etc.), and the tool will automatically calculate the new, smaller CIDR blocks and their respective IP ranges.

 

What is the subnet mask for a /24?

A /24 subnet mask is 255.255.255.0. It provides 254 usable IP addresses and is the most common default subnet for home routers and small office networks.

 

What is the subnet mask for a /16?

A /16 subnet mask is 255.255.0.0. It provides 65,534 usable IP addresses and is typically used by large organizations or ISPs.

 

How do I know if two IPs are on the same network?

To check if two IPs are on the same network, apply the same subnet mask to both using a Bitwise AND operation. If the resulting Network Address is the same for both, they are on the same local network. You can use this calculator to quickly check their network addresses.

 

What is an IP class?

In the early days of the internet, IPs were divided into rigid classes: Class A (/8), Class B (/16), and Class C (/24). CIDR replaced this system to allow more flexible subnet sizes. Our calculator still identifies the traditional class for educational purposes.

 

Can this tool calculate VLSM?

Currently, the subnet splitter divides the parent network into equal-sized smaller subnets. It does not yet support Variable Length Subnet Masking (VLSM), which involves creating subnets of different sizes.

 

Is this calculator free to use?

Yes, this Subnet Mask & CIDR IP Range Calculator is 100% free, requires no sign-up, and has no usage limits. You can perform as many calculations as you need.

 

Does the calculator work on mobile phones?

Yes, the calculator is fully responsive. Whether you are on a desktop computer, tablet, or smartphone, the interface adapts seamlessly to your screen size.

 

What is the 0.0.0.0/0 route?

0.0.0.0/0 is the default route. A CIDR of /0 means 0 bits are used for the network, encompassing the entire IPv4 address space. It is used in routing tables to represent “any unknown destination,” usually pointing to your ISP’s gateway.

 

Can I use this tool to configure my home router?

Absolutely. If you want to change your home network from a /24 (254 devices) to a /23 (510 devices) to accommodate a smart home setup, you can use this tool to find the correct subnet mask and DHCP range.

 

Why do we subtract 2 from the total IP count?

We subtract 2 because the very first IP in any subnet is reserved as the “Network Address” (used to identify the network itself), and the very last IP is reserved as the “Broadcast Address” (used to send a message to all devices on that network). Neither can be assigned to a computer.

 

Related Calculators

If you found this tool helpful, you might also benefit from these other calculators available on Calculators4All.com:

 
  1. IP Address to Binary Converter
  2. Hexadecimal to Decimal Converter
  3. Bandwidth Calculator
  4. MAC Address Lookup Tool
  5. File Transfer Time Calculator
  6. Bitwise Calculator (AND, OR, XOR)
  7. Base64 Encoder/Decoder
  8. Password Generator
  9. Random Number Generator
  10. Subnet Mask Cheat Sheet
 

Final Thoughts

Subnetting and CIDR math are fundamental skills for anyone working with modern technology. While the underlying binary logic can seem intimidating, tools like our Subnet Mask & CIDR IP Range Calculator remove the friction and guesswork from the equation.

 

Whether you are studying for your first IT certification, configuring a complex cloud architecture, or simply trying to set up a secure home network, this calculator is designed to give you fast, accurate, and visually intuitive results.

 

Don’t waste another minute scribbling binary numbers on a notepad. Bookmark this page, use the Subnet Calculator above, and make your next network configuration project a breeze!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top