Ruleblade

Subnet Calculator

Free IPv4 CIDR Calculator & Network Planning Tool

Calculate subnet masks, CIDR notation, IP ranges, broadcast addresses, and usable hosts instantly. Perfect for network engineers, system administrators, and IT professionals planning networks, VLANs, cloud infrastructure, and security configurations.

Calculate Subnet Information

Enter any IPv4 address
CIDR notation (/24) or subnet mask (255.255.255.0)
Quick examples:

What is a Subnet Calculator?

A subnet calculator is an essential networking tool that automates the complex mathematics of IP address subnetting. It instantly calculates network addresses, broadcast addresses, usable host ranges, and subnet masks from CIDR notation or traditional subnet masks. Whether you're a network engineer designing enterprise networks, a system administrator configuring servers, or an IT professional planning cloud infrastructure, a subnet calculator eliminates manual calculation errors and saves valuable time.

Subnetting is the process of dividing a large network into smaller, more manageable sub-networks (subnets). This practice improves network performance, enhances security through segmentation, and optimizes IP address allocation. Our subnet calculator supports IPv4 networks and provides comprehensive technical details including binary representations, hexadecimal IDs, wildcard masks, and supernet information.

The tool is particularly valuable for understanding CIDR (Classless Inter-Domain Routing) notation, which replaced the older classful network design. CIDR notation uses a slash followed by a number (e.g., /24) to indicate how many bits are used for the network portion of an IP address. This flexible approach allows for more efficient IP address allocation than the traditional Class A, B, and C system.

How to Use This Subnet Calculator

Basic Subnet Calculation

Using our subnet calculator is straightforward: enter any IPv4 address (such as 192.168.1.100) and specify either CIDR notation (like /24) or a traditional subnet mask (like 255.255.255.0). Click "Calculate Subnet" and instantly receive comprehensive network information including the network address, broadcast address, usable host range, total hosts, and technical details in binary and hexadecimal formats.

Understanding CIDR Notation

CIDR notation expresses subnet masks compactly using a forward slash followed by the number of network bits. For example, /24 means the first 24 bits are the network portion, leaving 8 bits for hosts. This equals 255.255.255.0 in traditional notation. Common CIDR values include /8 (16,777,214 hosts), /16 (65,534 hosts), /24 (254 hosts), and /30 (2 hosts, perfect for point-to-point links).

The higher the CIDR number, the smaller the subnet. A /32 represents a single host, while /0 represents the entire Internet. Understanding this relationship is crucial for efficient network design and IP address management.

Variable Length Subnet Masking (VLSM)

VLSM allows network administrators to use different subnet masks for different subnets within the same network, maximizing IP address efficiency. For instance, you might use /24 subnets for departments with 200 users, /27 subnets for smaller teams of 30, and /30 subnets for point-to-point links. Our calculator helps you plan VLSM schemes by showing all possible subnet masks for any given IP address.

Supernetting and Route Summarization

Supernetting combines multiple smaller networks into a larger one, simplifying routing tables and improving network efficiency. When you calculate a subnet, our tool automatically displays available supernets, showing larger networks that encompass your current subnet. This is invaluable for route aggregation, firewall rule optimization, and hierarchical network design.

Practical Subnet Calculator Examples

Example 1: Home Network Setup

For a typical home network, use 192.168.1.0/24. This private IP range provides 254 usable addresses (192.168.1.1 to 192.168.1.254), perfect for home routers, computers, smartphones, smart home devices, and IoT equipment. The /24 subnet is the most common home network configuration.

Example 2: Small Business Network

A small business with 50 employees might use 10.0.0.0/26, providing 62 usable hosts. This allows room for workstations, printers, servers, VoIP phones, and guest devices. You could segment further with VLANs: 10.0.0.0/27 for employees, 10.0.0.32/27 for guests, and 10.0.0.64/28 for servers.

Example 3: Enterprise Network Design

Large enterprises often use 10.0.0.0/8 as their private address space, then subdivide using VLSM. For instance: 10.1.0.0/16 for headquarters (65,534 hosts), 10.2.0.0/16 for branch offices, 10.100.0.0/16 for data centers, and 10.200.0.0/24 for management networks. Each can be further subdivided as needed.

Example 4: AWS VPC Configuration

When creating an AWS VPC, you might use 172.16.0.0/16 as your VPC CIDR block. Then create public subnets (172.16.1.0/24, 172.16.2.0/24) for load balancers and NAT gateways, private subnets (172.16.10.0/24, 172.16.11.0/24) for application servers, and database subnets (172.16.20.0/24, 172.16.21.0/24) in different availability zones.

Example 5: Azure and GCP Cloud Networks

In Azure or GCP, similar principles apply. Use 10.0.0.0/16 for your virtual network, then create subnets like 10.0.1.0/24 for web tier, 10.0.2.0/24 for app tier, 10.0.3.0/24 for database tier, and 10.0.255.0/27 for gateway subnet. Proper subnet planning ensures efficient resource allocation and network isolation.

Example 6: Firewall and Security Configurations

When configuring firewall rules, precise subnet calculations prevent security gaps. For instance, allowing 192.168.100.0/24 in a firewall rule permits exactly 254 hosts. Understanding that 192.168.100.0 is the network address and 192.168.100.255 is broadcast helps create accurate access control lists (ACLs) and security policies.

Key Features of Our Subnet Calculator

  • CIDR to Subnet Mask Conversion: Instantly convert between CIDR notation (/24) and traditional dotted-decimal subnet masks (255.255.255.0) in both directions.
  • IP Range Calculation: Automatically determine usable host ranges, showing the first and last assignable IP addresses in any subnet.
  • Supernet Discovery: Find all possible parent networks (supernets) for route aggregation and network summarization.
  • Binary Representation: View IP addresses and subnet masks in binary format for deep technical analysis and educational purposes.
  • IP Classification: Identify IP class (A, B, C, D, E) and type (Public, Private, Loopback, Reserved, Multicast, Link-Local).
  • Wildcard Mask: Generate wildcard masks for use in Cisco ACLs, OSPF configurations, and other network applications.
  • All Possible Masks: View all valid subnet masks for any IP address, perfect for VLSM planning and network redesign.
  • Copy to Clipboard: One-click copy for all calculated values, streamlining configuration workflows.

Common Use Cases for Subnet Calculators

🌐 Network Design & Planning

Design efficient IP addressing schemes for enterprise networks, plan VLAN segmentation, and allocate address space for departments and locations.

☁️ Cloud Infrastructure

Configure VPC subnets in AWS, Azure, or GCP. Plan multi-tier architectures with proper network isolation and efficient IP utilization.

🔧 Network Administration

Troubleshoot connectivity issues, verify network configurations, understand routing decisions, and document network topology.

📚 Education & Training

Learn subnetting concepts, prepare for networking certifications (CCNA, Network+), and understand binary-to-decimal conversions.

🔒 Security & Firewall

Create precise firewall rules, define security zones, calculate exact IP ranges for access control lists (ACLs).

🏢 ISP & Service Provider

Allocate customer IP blocks, plan network infrastructure, optimize routing tables through supernetting and route summarization.

Subnet Reference Tables & Cheat Sheet

CIDR to Subnet Mask Conversion Table

CIDRSubnet MaskWildcardTotal IPsUsable IPs
/32255.255.255.2550.0.0.011
/31255.255.255.2540.0.0.122*
/30255.255.255.2520.0.0.342
/29255.255.255.2480.0.0.786
/28255.255.255.2400.0.0.151614
/27255.255.255.2240.0.0.313230
/26255.255.255.1920.0.0.636462
/25255.255.255.1280.0.0.127128126
/24255.255.255.00.0.0.255256254
/23255.255.254.00.0.1.255512510
/22255.255.252.00.0.3.2551,0241,022
/21255.255.248.00.0.7.2552,0482,046
/20255.255.240.00.0.15.2554,0964,094
/19255.255.224.00.0.31.2558,1928,190
/18255.255.192.00.0.63.25516,38416,382
/17255.255.128.00.0.127.25532,76832,766
/16255.255.0.00.0.255.25565,53665,534
/15255.254.0.00.1.255.255131,072131,070
/14255.252.0.00.3.255.255262,144262,142
/13255.248.0.00.7.255.255524,288524,286
/12255.240.0.00.15.255.2551,048,5761,048,574
/11255.224.0.00.31.255.2552,097,1522,097,150
/10255.192.0.00.63.255.2554,194,3044,194,302
/9255.128.0.00.127.255.2558,388,6088,388,606
/8255.0.0.00.255.255.25516,777,21616,777,214

* /31 is used for point-to-point links (RFC 3021) where network and broadcast addresses are usable.

Private IP Address Ranges (RFC 1918)

ClassIP RangeCIDR NotationHosts AvailableTypical Use
Class A10.0.0.0 - 10.255.255.25510.0.0.0/816,777,214Large enterprises, ISPs
Class B172.16.0.0 - 172.31.255.255172.16.0.0/121,048,574Medium/large organizations
Class C192.168.0.0 - 192.168.255.255192.168.0.0/1665,534Home networks, small offices

Quick Subnet Reference Guide

/30

Point-to-point links

2 usable hosts

/29

Very small networks

6 usable hosts

/28

Small subnets

14 usable hosts

/27

Small office

30 usable hosts

/26

Medium office

62 usable hosts

/24

Standard network

254 usable hosts

/22

Large department

1,022 usable hosts

/20

Large network

4,094 usable hosts

Frequently Asked Questions About Subnet Calculators

What is subnetting?

Subnetting is the practice of dividing a network into smaller sub-networks called subnets. This improves network performance, enhances security through isolation, and allows more efficient use of IP addresses. Subnetting is essential for modern network design and is used in everything from home networks to enterprise data centers.

How do I calculate a subnet mask from CIDR notation?

CIDR notation (e.g., /24) indicates how many bits are set to 1 in the subnet mask. For /24, the first 24 bits are 1s: 11111111.11111111.11111111.00000000, which equals 255.255.255.0 in decimal. Our calculator performs this conversion instantly in both directions.

What's the difference between /24 and /25?

A /24 subnet has 256 total IP addresses (254 usable) with subnet mask 255.255.255.0. A /25 subnet has 128 total IP addresses (126 usable) with subnet mask 255.255.255.128. The /25 effectively splits a /24 network into two equal halves.

How many hosts are in a /24 subnet?

A /24 subnet contains 256 total IP addresses, with 254 usable for hosts. The first address is the network address and the last is the broadcast address, leaving 254 addresses (256 - 2) available for devices.

What is subnet mask 255.255.255.0?

255.255.255.0 is the most common subnet mask, equivalent to /24 in CIDR notation. It defines a network where the first three octets identify the network and the last octet identifies hosts, providing 254 usable IP addresses.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation is a compact way to specify IP addresses and their routing prefix. It uses a slash followed by 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 broadcast address?

The broadcast address is the last IP in a subnet. To calculate it, convert the IP and subnet mask to binary, invert the mask, then OR it with the IP address. Our calculator does this automatically, showing you the broadcast address for any subnet.

What are usable hosts?

Usable hosts are IP addresses available for devices in a subnet. This equals total IPs minus 2 (network and broadcast addresses). For example, a /24 subnet has 256 total IPs but only 254 usable for actual devices.

What's the difference between public and private IP addresses?

Public IP addresses are routable on the Internet and globally unique. Private IP addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are reserved for internal networks and not routable on the Internet without NAT (Network Address Translation).

What is supernetting?

Supernetting (or route aggregation) combines multiple smaller networks into a larger one. For example, combining 192.168.0.0/24 and 192.168.1.0/24 creates the supernet 192.168.0.0/23. This reduces routing table entries and simplifies network management.

How do I subnet a Class C network?

A Class C network (e.g., 192.168.1.0/24) can be subdivided by increasing the CIDR prefix. For example, /25 creates 2 subnets of 126 hosts each, /26 creates 4 subnets of 62 hosts, /27 creates 8 subnets of 30 hosts, and so on.

What is a wildcard mask?

A wildcard mask is the inverse of a subnet mask, used in Cisco access control lists (ACLs) and OSPF configurations. Where a subnet mask has a 1, a wildcard mask has a 0, and vice versa. For example, subnet mask 255.255.255.0 has wildcard mask 0.0.0.255.

What is VLSM?

VLSM (Variable Length Subnet Masking) allows using different subnet masks within the same network. This maximizes IP address efficiency by allocating appropriately sized subnets to different departments or functions based on their actual needs.

How many subnets can I create from a /24?

From a /24, you can create: 2 /25 subnets, 4 /26 subnets, 8 /27 subnets, 16 /28 subnets, 32 /29 subnets, 64 /30 subnets, or 128 /31 subnets. The number of subnets doubles with each additional bit borrowed.

What is the network address?

The network address is the first IP in a subnet, used to identify the network itself. All host bits are set to 0. For example, in 192.168.1.0/24, the network address is 192.168.1.0. It cannot be assigned to a device.

Why do we need subnetting?

Subnetting is needed to: efficiently use IP addresses, improve network performance by reducing broadcast domains, enhance security through network segmentation, enable better organization of network resources, and simplify network management and troubleshooting.

What is a /32 subnet?

A /32 subnet represents a single host address with subnet mask 255.255.255.255. It's commonly used in routing tables for host routes, loopback addresses, and to specify a single IP address in firewall rules or access control lists.

What is a /30 subnet used for?

A /30 subnet provides exactly 2 usable IP addresses (4 total), making it perfect for point-to-point links between routers or network devices where only two devices need to communicate directly.

How do I calculate the number of subnets?

The number of subnets equals 2^n, where n is the number of bits borrowed from the host portion. For example, borrowing 3 bits from a /24 to create /27 subnets gives 2^3 = 8 subnets.

What are Class A, B, and C networks?

These are classful network divisions: Class A (1.0.0.0 to 126.0.0.0, /8 default), Class B (128.0.0.0 to 191.255.0.0, /16 default), and Class C (192.0.0.0 to 223.255.255.0, /24 default). Modern networks use CIDR instead, which is more flexible.

What is the default gateway?

The default gateway is a router's IP address that devices use to communicate outside their local subnet. It's typically the first or last usable IP in a subnet (e.g., 192.168.1.1 or 192.168.1.254 in a /24 network).

Can I use 0 or 255 in an IP address?

Yes, but with restrictions. 0 typically indicates network addresses (e.g., 10.0.0.0) and 255 often appears in broadcast addresses (e.g., 192.168.1.255). In modern networks, subnet zero and all-ones subnets are allowed, but specific octets of 0 and 255 can be used in IP addresses.

What is the purpose of a subnet mask?

A subnet mask separates an IP address into network and host portions. It tells devices which part of an IP address identifies the network and which part identifies the specific host. This is essential for routing decisions and determining if two IPs are on the same subnet.

How do I choose the right subnet size?

Choose subnet size based on: current number of hosts needed, growth projections (typically 30-50% overhead), organizational structure, security requirements, and efficient IP address utilization. Always round up to the nearest power of 2 that accommodates your needs.

What is the difference between a router and a subnet?

A subnet is a logical division of an IP network, while a router is a physical or virtual device that forwards traffic between different subnets or networks. Routers typically sit at subnet boundaries and have IP addresses in each subnet they connect.

Automate Your Firewall Management

Tired of Manual Firewall Configuration?

While subnet calculations are essential, managing firewall rules manually across multiple vendors is time-consuming and error-prone. Ruleblade automates your entire firewall lifecycle from risk assessment to policy orchestration.

Automated Risk DetectionIdentify exposure, unused rules, and compliance gaps instantly
Multi-Vendor OrchestrationManage Palo Alto, Fortinet, Checkpoint, and more from one platform
Reduce MTTRFrom hours to minutes with automated remediation workflows
100%
Rule Accuracy
24/7
Continuous Monitoring
Copyright 2025 | All Rights Reserved | Privacy Policy