Home/Tools/Network/Free IP Subnet Calculator - IPv4 & IPv6 CIDR Tool

Free IP Subnet Calculator - IPv4 & IPv6 CIDR Tool

Calculate IPv4/IPv6 subnets instantly. Get network ranges, subnet masks, usable hosts & CIDR notation. Free professional tool - no registration needed.

100% Private - Runs Entirely in Your Browser
No data is sent to any server. All processing happens locally on your device.
Loading Free IP Subnet Calculator - IPv4 & IPv6 CIDR Tool...
Loading interactive tool...

Planning a Network Migration?

Our architects design scalable, secure network topologies for cloud and on-premise environments.

What Is Subnet Calculation

Subnet calculation divides an IP network into smaller, more manageable sub-networks (subnets) by manipulating the subnet mask. Subnetting is fundamental to IP network design, allowing administrators to control broadcast domains, improve security through segmentation, and efficiently allocate IP addresses. Every network engineer, system administrator, and cloud architect needs to understand subnetting.

An IP address has two parts: the network portion (identifying the subnet) and the host portion (identifying the device within that subnet). The subnet mask determines where this boundary falls. A larger network prefix means more subnets with fewer hosts each; a smaller prefix means fewer subnets with more hosts. Getting this calculation right is essential for preventing IP conflicts, optimizing routing, and meeting security requirements.

How Subnetting Works

IPv4 addresses are 32 bits long, written as four octets in dotted decimal notation. The subnet mask (also expressed in CIDR notation) defines the network boundary:

CIDRSubnet MaskNetwork BitsHost BitsUsable Hosts
/24255.255.255.0248254
/25255.255.255.128257126
/26255.255.255.19226662
/27255.255.255.22427530
/28255.255.255.24028414
/29255.255.255.2482936
/30255.255.255.2523022
/16255.255.0.0161665,534

Key formulas:

  • Usable hosts = 2^(host bits) - 2 (subtract network and broadcast addresses)
  • Number of subnets = 2^(borrowed bits)

Example: Splitting 192.168.1.0/24 into four subnets requires borrowing 2 bits (2^2 = 4 subnets), creating /26 subnets with 62 usable hosts each:

  • 192.168.1.0/26 (hosts .1 - .62)
  • 192.168.1.64/26 (hosts .65 - .126)
  • 192.168.1.128/26 (hosts .129 - .190)
  • 192.168.1.192/26 (hosts .193 - .254)

Common Use Cases

  • Network design: Plan IP address allocation for offices, data centers, and cloud VPCs
  • VLAN planning: Assign appropriately sized subnets to different VLANs (servers, workstations, IoT, guests)
  • Cloud networking: Size AWS VPC subnets, Azure virtual networks, and GCP subnetworks
  • Security segmentation: Isolate sensitive systems (databases, management interfaces) into separate subnets with firewall controls
  • Troubleshooting: Verify that devices are on the correct subnet and can communicate with their gateway

Best Practices

  1. Plan for growth — Allocate subnets larger than current needs; re-subnetting a production network is disruptive
  2. Use /30 or /31 for point-to-point links — Router-to-router connections only need 2 addresses; don't waste a /24
  3. Reserve the first and last addresses — The first IP is the network address and the last is the broadcast address; neither is assignable to hosts
  4. Document your IP plan — Maintain a centralized IPAM (IP Address Management) record of all subnets, their purpose, and utilization
  5. Align subnets to bit boundaries — Subnets that align to octet boundaries (/8, /16, /24) are easier to manage and troubleshoot

References & Citations

  1. Y. Rekhter et al.. (1996). RFC 1918: Address Allocation for Private Internets. Internet Engineering Task Force. Retrieved from https://www.rfc-editor.org/rfc/rfc1918 (accessed January 2025)
  2. V. Fuller, T. Li. (2006). RFC 4632: Classless Inter-domain Routing (CIDR). Internet Engineering Task Force. Retrieved from https://www.rfc-editor.org/rfc/rfc4632 (accessed January 2025)
  3. A. Retana et al.. (2000). RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links. Internet Engineering Task Force. Retrieved from https://www.rfc-editor.org/rfc/rfc3021 (accessed January 2025)

Note: These citations are provided for informational and educational purposes. Always verify information with the original sources and consult with qualified professionals for specific advice related to your situation.

Frequently Asked Questions

Common questions about the Free IP Subnet Calculator - IPv4 & IPv6 CIDR Tool

Subnetting is the practice of dividing a network into smaller sub-networks (subnets) for better management, security, and efficiency. Key benefits: (1) Efficient IP allocation - Reduces IP waste by sizing subnets to actual needs. (2) Network segmentation - Separates departments, devices, or security zones. (3) Improved performance - Reduces broadcast traffic within smaller networks. (4) Enhanced security - Isolates sensitive systems, limits attack surface. (5) Organized management - Logical network structure mirrors organizational structure. Example: A /24 network (192.168.1.0/24) with 254 hosts can be split into 4 /26 subnets (62 hosts each), allowing separate networks for Sales, Engineering, HR, and Guest WiFi. Modern networks use CIDR (Classless Inter-Domain Routing) instead of the old class-based system (Class A, B, C).

CIDR (Classless Inter-Domain Routing) notation is a compact way to represent IP addresses and their routing prefix. Format: IP_ADDRESS/PREFIX_LENGTH. The prefix length (number after /) indicates how many bits are used for the network portion. Examples: 192.168.1.0/24 - /24 means first 24 bits are network (192.168.1), last 8 bits are hosts (0-255), 254 usable hosts. 10.0.0.0/8 - /8 means first 8 bits are network (10), last 24 bits are hosts, 16,777,214 usable hosts (Class A). 172.16.0.0/12 - /12 means first 12 bits are network, 1,048,574 usable hosts. Common Subnet Sizes: /32 - Single host (1 IP), /30 - Point-to-point links (2 usable), /29 - Small subnet (6 usable), /24 - Standard subnet (254 usable), /16 - Large subnet (65,534 usable). The smaller the prefix length, the larger the subnet. /24 is smaller than /16, but /25 is smaller than /24.

Subnet masks define the network and host portions of an IP address. Manual calculation: Step 1: Convert prefix to subnet mask - /24 → 255.255.255.0 (24 ones, 8 zeros in binary). Step 2: Binary representation - /26 = 11111111.11111111.11111111.11000000 = 255.255.255.192. Step 3: Calculate usable hosts - 2^(host bits) - 2 (subtract network and broadcast addresses). Step 4: Find network boundaries - Network address: IP AND subnet mask, Broadcast: All host bits set to 1, First usable: Network + 1, Last usable: Broadcast - 1. Common Subnet Masks: /30 = 255.255.255.252 (2 usable), /29 = 255.255.255.248 (6 usable), /28 = 255.255.255.240 (14 usable), /27 = 255.255.255.224 (30 usable), /26 = 255.255.255.192 (62 usable), /25 = 255.255.255.128 (126 usable), /24 = 255.255.255.0 (254 usable). Pro tip: Learn common masks by memory for faster network planning.

Private IP address ranges are reserved for internal networks and cannot be routed on the public Internet. Defined in RFC 1918: 10.0.0.0/8 (Class A) - 10.0.0.0 to 10.255.255.255, 16,777,216 addresses, used by large enterprises. 172.16.0.0/12 (Class B) - 172.16.0.0 to 172.31.255.255, 1,048,576 addresses, common in medium organizations. 192.168.0.0/16 (Class C) - 192.168.0.0 to 192.168.255.255, 65,536 addresses, typical for home/small office. When to use: Internal company networks, Home networks, Development/testing environments, Private cloud infrastructure. Connectivity: Devices use NAT (Network Address Translation) to access Internet through a public IP, Multiple devices share one public IP, Provides basic security (not directly accessible from Internet). IPv6 equivalent: fc00::/7 (Unique Local Addresses), but IPv6's massive address space reduces need for private ranges. Always use private IPs internally and reserve public IPs only for Internet-facing services.

Every subnet contains special-purpose addresses: Network Address - First IP in subnet, identifies the network itself (e.g., 192.168.1.0/24 → 192.168.1.0), cannot be assigned to hosts, all host bits are 0, used in routing tables. Broadcast Address - Last IP in subnet, sends packets to all hosts in subnet (e.g., 192.168.1.0/24 → 192.168.1.255), cannot be assigned to hosts, all host bits are 1, used for network-wide announcements. Usable IP Range - All IPs between network and broadcast, can be assigned to hosts/devices (e.g., 192.168.1.0/24 → 192.168.1.1 to 192.168.1.254), total usable = 2^(host bits) - 2. Example: 192.168.1.0/26 - Network: 192.168.1.0, First usable: 192.168.1.1, Last usable: 192.168.1.62, Broadcast: 192.168.1.63, Total usable: 62 hosts. Special case /31 and /32: /32 (single host) - Only one IP, used for loopback or specific host routes. /31 (point-to-point links) - RFC 3021 allows 2 usable IPs without network/broadcast for router links.

When subnetting for departmentsor VLANs, follow this planning process: Step 1: Determine requirements - How many subnets needed?, Hosts per subnet?, Future growth (add 30-50% capacity). Step 2: Choose subnet size - Sales: 40 users → /26 (62 hosts), Engineering: 100 users → /25 (126 hosts), HR: 15 users → /27 (30 hosts), Guest WiFi: 50 devices → /26 (62 hosts). Step 3: Assign non-overlapping ranges - Sales: 192.168.1.0/26 (192.168.1.1-62), Engineering: 192.168.1.64/25 (192.168.1.65-190), HR: 192.168.1.192/27 (192.168.1.193-222), Guest: 192.168.2.0/26 (192.168.2.1-62). Step 4: Document and implement - Create IP allocation spreadsheet, Configure VLANs on switches, Set up DHCP scopes, Implement inter-VLAN routing, Apply security policies (ACLs). Best practices: Align subnets with VLANs 1:1, Use meaningful VLAN IDs (Sales=VLAN 10), Leave room for growth, Keep documentation updated.

VLSM (Variable Length Subnet Masking) allows using different subnet sizes within the same network, unlike fixed-length subnetting where all subnets are the same size. Traditional Fixed-Length (wasteful): Divide 192.168.1.0/24 into 4 equal /26 subnets (62 hosts each), Small HR department (10 users) wastes 52 IPs, Large Engineering (100 users) doesn't fit. VLSM (efficient): Engineering: 192.168.1.0/25 (126 hosts) - perfect fit, Sales: 192.168.1.128/26 (62 hosts), HR: 192.168.1.192/27 (30 hosts), Management: 192.168.1.224/28 (14 hosts), Point-to-point links: 192.168.1.240/30 (2 hosts each). Benefits: Reduces IP waste, Right-sizes subnets to actual needs, Maximizes address utilization, Essential for ISPs and large organizations. VLSM Rules: Assign largest subnets first, Ensure no overlap, Align subnet boundaries properly (network addresses must fall on subnet boundaries). VLSM requires careful planning but dramatically improves IP efficiency in complex networks.

IPv6 subnetting is simpler but fundamentally different from IPv4 due to the massive address space: Address Space: IPv4: 32 bits (4.3 billion addresses), IPv6: 128 bits (340 undecillion addresses - effectively unlimited). Standard Allocation: IPv4: Organizations receive /8 to /24, conserve carefully, use VLSM and NAT. IPv6: Organizations receive /32 or /48, allocate /64 to every subnet (18 quintillion addresses per subnet!). Subnet Structure: IPv4: Variable subnet sizes (/30 to /8), carefully calculated. IPv6: Almost always /64 for end networks (SLAAC requirement), /48 for organizations (65,536 /64 subnets), /56 for small sites (256 /64 subnets). Key Differences: No broadcast addresses in IPv6 (uses multicast), No NAT needed (every device gets public IP), No need for private ranges (ample public addresses), Simpler subnetting (just assign /64s). Example IPv6 Allocation: ISP gives company 2001:db8:1234::/48, IT creates subnets: Sales: 2001:db8:1234:10::/64, Engineering: 2001:db8:1234:20::/64, WiFi: 2001:db8:1234:30::/64. The simplification comes from abundance - stop conserving and use /64 everywhere.

ℹ️ Disclaimer

This tool is provided for informational and educational purposes only. All processing happens entirely in your browser - no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results. Use at your own discretion.