IP Subnet Calculator

Calculate IP subnets, network addresses, and host ranges with CIDR notation or subnet masks. Professional subnet planning tool for network administrators and IT professionals.

Calculate Subnet

Enter IP address with CIDR notation or subnet mask to calculate network details

Example: 192.168.1.0/24, 10.0.0.0/8, or 172.16.0.0/12

Common CIDR Blocks

/24 254 hosts
/25 126 hosts
/26 62 hosts
/27 30 hosts
/28 14 hosts
/29 6 hosts
/30 2 hosts

IP Subnet Calculator: CIDR, VLSM & Network Planning Tool

Calculate IPv4 subnets instantly following RFC 4632 (CIDR) and RFC 950 (Subnetting) specifications. Professional network planning tool supporting VLSM, supernetting, and RFC 1918 private addressing.

What is IP Subnetting?

IP subnetting is the hierarchical subdivision of IPv4 address space (RFC 791) into smaller broadcast domains called subnets. This fundamental technique, standardized in RFC 950, enables efficient address allocation, reduces broadcast storms, improves security through network segmentation, and optimizes routing table management. Subnetting is essential for network engineers managing enterprise WANs, cloud VPCs (AWS, Azure, GCP), and ISP infrastructure.

Our subnet calculator performs binary AND operations between IP addresses and subnet masks following IANA IPv4 allocation policies. Supporting both CIDR notation and dotted-decimal subnet masks, it calculates network addresses, broadcast addresses, usable host ranges, and wildcard masks for ACL configurations.

After calculating your subnets, verify routing with DNS Lookup to check reverse DNS (PTR records), use My IP Address to determine your public IP's network assignment, and validate connectivity with HTTP Status Checker.

Understanding CIDR Notation (RFC 4632)

Classless Inter-Domain Routing (CIDR), defined in RFC 4632, replaced classful addressing in 1993 to combat IPv4 exhaustion. CIDR enables Variable Length Subnet Masking (VLSM) per RFC 1878, allowing networks of arbitrary size rather than being constrained to Class A (/8), B (/16), or C (/24) boundaries. This flexibility reduced routing table entries through route aggregation (supernetting).

CIDR Notation Format and Calculations

CIDR notation expresses networks as IP_ADDRESS/PREFIX_LENGTH, where prefix length indicates the number of leading 1 bits in the subnet mask. Calculate usable hosts with formula: 2^(32-prefix) - 2 (subtracting network and broadcast addresses). Examples with binary representations:

  • 192.168.1.0/24: Mask 11111111.11111111.11111111.00000000 = 255.255.255.0 → 254 usable hosts (2^8 - 2)
  • 10.0.0.0/8: RFC 1918 Class A private range → 16,777,214 usable hosts (2^24 - 2)
  • 172.16.0.0/12: RFC 1918 Class B aggregate → 1,048,574 usable hosts (2^20 - 2), spans 172.16.0.0-172.31.255.255
  • 192.168.1.0/30: Point-to-point link optimized per RFC 3021 → 2 usable hosts (2^2 - 2), commonly used for WAN links
  • 10.10.10.0/31: RFC 3021 unnumbered link → 2 hosts without broadcast (special case for point-to-point)

Verify calculated subnets are routable by checking BGP announcements with Hurricane Electric BGP Toolkit and use IP geolocation to confirm your public IP's assigned network block.

IPv4 Address Classes (Legacy Classful Routing)

Before CIDR's introduction in 1993, IPv4 used classful addressing defined in RFC 791. While obsolete for routing (replaced by CIDR), understanding classful networks remains relevant for legacy systems, network troubleshooting, and understanding address space allocation by IANA. First octet determines class:

Class A (0.0.0.0/1)

  • Range: 1.0.0.0 - 126.255.255.255
  • First bit: 0 (binary: 0xxxxxxx)
  • Default mask: /8 (255.0.0.0)
  • Networks: 126 (excludes 0.0.0.0 and 127.0.0.0)
  • Hosts/network: 16,777,214 (2^24 - 2)
  • Modern use: Major ISPs, cloud providers

Class B (128.0.0.0/2)

  • Range: 128.0.0.0 - 191.255.255.255
  • First bits: 10 (binary: 10xxxxxx)
  • Default mask: /16 (255.255.0.0)
  • Networks: 16,384 possible
  • Hosts/network: 65,534 (2^16 - 2)
  • Modern use: Universities, medium enterprises

Class C (192.0.0.0/3)

  • Range: 192.0.0.0 - 223.255.255.255
  • First bits: 110 (binary: 110xxxxx)
  • Default mask: /24 (255.255.255.0)
  • Networks: 2,097,152 possible
  • Hosts/network: 254 (2^8 - 2)
  • Modern use: SMBs, home networks, VPNs

Special address ranges: Class D (224.0.0.0/4) for multicast (RFC 5771), Class E (240.0.0.0/4) reserved per RFC 1112, 127.0.0.0/8 for loopback testing. Check if your IP falls in special ranges using IP geolocation tool.

RFC 1918 Private IP Addresses and NAT

RFC 1918 designates three IPv4 address blocks for private internets, non-routable on the public internet without NAT (RFC 3022). These ranges conserve public IPv4 addresses, enable network segmentation, and provide security through obscurity. Allocated by IANA Special-Purpose Address Registry:

RFC 1918 Private Address Allocations

  • 10.0.0.0/8 (Class A): 10.0.0.0 - 10.255.255.255 → 16,777,216 addresses. Use for large enterprises, cloud VPCs (AWS, Azure, GCP). Calculate with ipcalc 10.0.0.0/8
  • 172.16.0.0/12 (Class B): 172.16.0.0 - 172.31.255.255 → 1,048,576 addresses. Common for Docker default bridge network (172.17.0.0/16), medium enterprises. Spans 16 Class B networks
  • 192.168.0.0/16 (Class C): 192.168.0.0 - 192.168.255.255 → 65,536 addresses. Universal for home routers, SMB networks, VPN pools. Contains 256 Class C networks

Additional special-use addresses: 100.64.0.0/10 (RFC 6598) for Carrier-Grade NAT (CGN), 192.0.2.0/24 TEST-NET-1 (RFC 5737) for documentation. Verify your public IP isn't in private ranges using What Is My IP, then check DNS resolution with DNS Lookup.

Subnet Mask Calculations

Understanding Subnet Masks

A subnet mask determines which portion of an IP address represents the network and which portion represents the host. Subnet masks use a contiguous series of 1s followed by 0s in binary format, typically expressed in dotted decimal notation.

Common Subnet Mask Examples

CIDRSubnet MaskUsable HostsCommon Usage
/30255.255.255.2522Point-to-point links
/29255.255.255.2486Small device groups
/28255.255.255.24014Very small networks
/27255.255.255.22430Small office networks
/26255.255.255.19262Department networks
/24255.255.255.0254Standard office networks

Network Address Calculations

Key Network Components

Every subnet contains several important addresses that our calculator determines automatically:

Network Address

The first address in a subnet, where all host bits are set to zero. This address identifies the network itself and cannot be assigned to hosts.

Broadcast Address

The last address in a subnet, where all host bits are set to one. Used for broadcasting packets to all hosts on the network segment.

Host Address Range

All addresses between the network and broadcast addresses that can be assigned to network devices, servers, and workstations.

Default Gateway

Typically the first or last usable host address, assigned to the router that provides connectivity to other networks and the internet.

Enterprise Subnetting Best Practices

Strategic Network Planning and IPAM

Effective subnet design following Cisco hierarchical network design principles requires balancing current requirements with 3-5 year growth projections. Implement IP Address Management (IPAM) using tools like Infoblox, phpIPAM, or NetBox for tracking allocations and preventing conflicts:

  • Allocate for 200% growth: Use /22 instead of /24 if currently need 200 hosts, anticipating doubling
  • Implement hierarchical addressing: Aggregate by geography (site-level /16), function (department-level /20), or application tier (web/app/db)
  • Security zone segmentation: Separate DMZ, internal, management using BCP 38 (RFC 2827) anti-spoofing ACLs
  • Route summarization: Design with CIDR aggregation in mind—align boundaries to power-of-2 for clean summarization
  • IPAM documentation: Track assignments in NetBox with circuit IDs, VLAN mappings, DNS zones. Verify DNS with DNS Lookup
  • VLAN-to-subnet alignment: Follow IEEE 802.1Q with one subnet per VLAN for Layer 2/3 boundary clarity

Variable Length Subnet Masking (VLSM) Optimization

VLSM, enabled by RFC 1878 and supported by classless routing protocols (OSPF, BGP, EIGRP), maximizes address utilization by applying different prefix lengths within the same supernet. Essential for modern network design:

  • Efficient allocation: Use /30 for point-to-point links (2 hosts), /28 for small segments (14 hosts), /24 for departments (254 hosts) within same 10.0.0.0/8
  • Zero waste on WAN links: /30 (255.255.255.252) for router-to-router connections instead of /24 wasting 252 addresses per link
  • Flexible cloud design: AWS VPCs use VLSM with /16 VPC, /24 public subnets, /20 private subnets from same block
  • Route summarization: Aggregate multiple VLSM subnets into single routing entry (e.g., summarize 10.1.0.0/24 through 10.1.3.0/24 as 10.1.0.0/22)

VLSM calculation example: Given 172.16.0.0/16, subnet into dept networks (need 500 hosts each = /23) and point-to-point links (/30). Allocate largest first: 172.16.0.0/23 (dept1), 172.16.2.0/23 (dept2), then use 172.16.4.0/30, 172.16.4.4/30 for links. Test routing with connectivity checker.

IPv6 Subnetting and Address Architecture

IPv6 (RFC 4291) uses 128-bit addresses providing 340 undecillion addresses, eliminating IPv4 exhaustion concerns. IPv6 subnetting follows hierarchical allocation with standardized boundaries. Google reports 40%+ IPv6 adoption globally as of 2024:

IPv6 Address Structure and Subnetting

Practical example: ISP receives 2001:db8::/32 from RIR → Allocates 2001:db8:1234::/48 to enterprise → Enterprise creates /64 subnets (2001:db8:1234:0001::/64, 2001:db8:1234:0002::/64, etc.). Check IPv6 connectivity with IPv6 address checker and verify AAAA records via DNS Lookup.

Subnet Calculator Usage Guide

Step-by-Step Calculation Process

Our subnet calculator supports two input methods for maximum flexibility:

CIDR Notation Method

  1. Enter network address with CIDR prefix (e.g., 192.168.1.0/24)
  2. Click "Calculate Network" to process
  3. Review comprehensive subnet information
  4. Use results for network configuration

IP + Subnet Mask Method

  1. Enter IP address in first field
  2. Enter subnet mask in dotted decimal format
  3. Click "Calculate Network" to process
  4. Review detailed calculation results

Common Subnetting Scenarios

Small Office Network Design

Scenario: Office with 50 employees needing network access

Solution: Use 192.168.1.0/26 (62 hosts) or 192.168.1.0/25 (126 hosts) for future growth

Multi-Site Corporate Network

Scenario: Company with multiple offices requiring interconnected networks

Solution: Use 10.0.0.0/8 with /16 subnets per site and /24 subnets per department

Data Center Network

Scenario: High-density server environment with hundreds of servers

Solution: Use /22 or /21 subnets for server farms, /30 for inter-switch links

Troubleshooting Subnet Issues

Common Network Problems and Diagnostic Tools

Incorrect subnetting causes layer 3 connectivity failures, routing loops, and security vulnerabilities. Use our calculator with diagnostic commands to verify configurations following RFC 1812 router requirements:

Subnet Configuration Troubleshooting

  • IP address conflicts: Overlapping subnet ranges detected with arp-scan -l or nmap host discovery. Check IPAM for allocation errors
  • Routing problems: Verify with ip route show (Linux) or route print (Windows). Confirm next-hop matches subnet gateway using IP lookup
  • DHCP scope errors: RFC 2131 DHCP ranges extending beyond subnet broadcast address. Validate with dhcpd.conf audit
  • Firewall ACL mismatches: Cisco access-list wildcard masks misconfigured. Use inverse mask (e.g., /24 = 0.0.0.255 wildcard)
  • Asymmetric routing: Return path via different subnet due to OSPF cost metrics. Trace with traceroute -n
  • Subnet mask mismatches: Hosts configured with /24 on /25 network. Diagnose with netstat -rn and verify with calculator

Advanced diagnostics: Use Wireshark packet captures to analyze ARP broadcasts, verify default gateway with tcpdump -i eth0 arp, and confirm routing with HTTP connectivity tests. Check DNS reverse zones (PTR records) using DNS Lookup for proper subnet delegation.

Advanced Subnet Planning

Network Address Translation (NAT) and Port Translation

Network Address Translation (NAT), standardized in RFC 3022, enables private RFC 1918 networks to access the internet using shared public IP addresses. Critical for IPv4 conservation and security boundary enforcement:

NAT Implementation Types

  • Static NAT (1:1): One-to-one mapping between private and public IPs. Use for DMZ servers needing inbound access. Configure with ip nat inside source static on Cisco
  • Dynamic NAT (Pool): Many-to-many from pool of public IPs per RFC 3022 Section 2.2. Limited scalability due to pool exhaustion
  • PAT/NAPT (Overload): Port Address Translation—thousands of internal hosts share single public IP via port multiplexing. Most common NAT type for home/SMB networks
  • Carrier-Grade NAT (CGN): RFC 6598 (100.64.0.0/10) dual-NAT by ISPs. Causes issues with peer-to-peer protocols, gaming, VoIP. Check your IP type with IP detector
  • NAT64: RFC 6146 IPv6-to-IPv4 translation for IPv6-only networks accessing IPv4 internet

NAT subnet planning considerations: Internal subnets must be RFC 1918 ranges. Calculate external PAT capacity with formula: (65535 - 1024) ports × public IPs ÷ average connections per host. Typical PAT supports 4000+ simultaneous sessions per public IP. Verify NAT translation with show ip nat translations. Test external connectivity using HTTP status checker.

Software-Defined Networking (SDN) and Overlay Networks

SDN environments like VMware NSX, Cisco ACI, or Kubernetes CNI require dual-layer subnet planning for underlay (physical) and overlay (logical) networks:

SDN and Overlay Network Subnetting

  • VXLAN encapsulation: RFC 7348 creates 24-bit segment IDs (16.7M networks) over Layer 3 underlay. Underlay needs /31 point-to-point subnets for spine-leaf, overlay uses any RFC 1918 ranges
  • Kubernetes Pod networking: Each node gets /24 subnet from cluster CIDR (typically 10.244.0.0/16). CNI plugins like Calico use BGP for routing, Flannel uses VXLAN overlays
  • Micro-segmentation: NSX uses /29 or /28 for individual application tiers with distributed firewall rules at hypervisor level, bypassing physical network constraints
  • GRE/NVGRE tunnels: RFC 2784 GRE and RFC 7364 NVGRE provide L2 over L3. Plan underlay with non-overlapping addressing
  • GENEVE: RFC 8926 generic encapsulation for OpenStack Neutron, VMware NSX-T. More flexible than VXLAN with extensible headers

Cloud Provider Subnet Best Practices

Public cloud platforms impose specific subnetting constraints and best practices for VPC/VNet design. Plan carefully as resizing often requires migration:

AWS, Azure, and GCP Subnetting Guidelines

  • AWS VPC sizing: Use /16 VPC (65,536 IPs) with /24 public subnets, /20 private subnets per AZ. AWS reserves 5 IPs per subnet (network, VPC router, DNS, future, broadcast). See AWS VPC subnet documentation
  • Azure VNet structure: /16 VNet with /24 subnets per tier. Reserve /27 for Azure Firewall, /26 for Application Gateway. Review Azure VNet FAQ
  • GCP custom mode VPCs: Global VPC with regional /20 subnets expandable to /16. Secondary ranges for GKE pods/services. Check GCP VPC concepts
  • VPC peering considerations: Avoid overlapping CIDRs between peered VPCs. Use hierarchical allocation: 10.0.0.0/16 (prod), 10.1.0.0/16 (staging), 10.2.0.0/16 (dev)
  • Transit Gateway routing: AWS Transit Gateway requires unique CIDR per VPC attachment. Plan with supernet summarization for route table efficiency
  • Service endpoints impact: Private Link, VPC endpoints don't consume IPs but require subnet association. Test connectivity with HTTP checker

Hybrid cloud networking: Connect on-premises subnets to cloud VPCs via VPN (IPsec RFC 4301) or Direct Connect/ExpressRoute. Ensure no CIDR overlap between datacenter and cloud ranges. Use IPAM tools like NetBox to track global allocations and prevent conflicts during cloud migrations.

Related Network Tools

Complement subnet calculations with our network diagnostic and planning tools for comprehensive infrastructure management:

Command-line alternatives: Use ipcalc on Linux/macOS, sipcalc for advanced IPv6, or ipconfig on Windows. Verify routing with traceroute or mtr for path analysis across subnet boundaries.