IP Subnet Calculator

IP Subnet Calculator

Calculate network details, host ranges, and subnet divisions

Enter IP with prefix (e.g., 10.0.0.0/24)
Enter IPv6 with prefix (e.g., 2001:db8::/64)

Subnet Division

Divide current network into smaller subnets

Network Information

Core Network Details

Network Address
-
Broadcast Address
-
First Host
-
Last Host
-
Subnet Mask
-
Wildcard Mask
-
CIDR Notation
-
IP Class
-

Host Capacity

Total Addresses
Usable Hosts
Network Type
Binary (IP)
-
Binary (Mask)
-
Integer ID
-
Hex ID
-
in-addr.arpa
-
IPv6 Mapped
-

IPv6 Information

Full Address
-
Expanded
-
Prefix Length
-
Network Range
-
Address Type
-
Total Addresses
-

Subnet Division Results

#NetworkMaskHost RangeBroadcastHosts
Copied to clipboard

Using The Subnet Calculator

This calculator provides comprehensive subnet information for both IPv4 and IPv6 addresses. 

IPv4 Calculations

CIDR Notation: Enter addresses like 192.168.1.0/24 for quick calculations.

Decimal Notation: Enter IP address and subnet mask separately. Use the preset selector for common masks.

Results: Network address, broadcast, usable host range, subnet information, and multiple format conversions appear immediately in the right column.

IPv6 Calculations

Enter IPv6 addresses with prefix length (e.g., 2001:db8::/64).

The calculator expands abbreviated addresses, determines address type, and calculates total available addresses for the prefix length.

IPv6 calculations don’t require subnet division since standard /64 subnets provide virtually unlimited addresses.

Subnet Division

After calculating an IPv4 subnet, use the division tool in the left column to split it into smaller subnets.

By Subnet Count: Specify how many subnets you need.

By Host Count: Specify how many hosts each subnet should support.

CIDR Notation Reference

Quick reference for converting between CIDR notation and subnet masks:

CIDRSubnet MaskWildcard MaskUsable Hosts
/24255.255.255.00.0.0.255254
/25255.255.255.1280.0.0.127126
/26255.255.255.1920.0.0.6362
/27255.255.255.2240.0.0.3130
/28255.255.255.2400.0.0.1514
/29255.255.255.2480.0.0.76
/30255.255.255.2520.0.0.32
/31255.255.255.2540.0.0.12*
/32255.255.255.2550.0.0.01*

* /31 networks support 2 usable addresses (RFC 3021). /32 networks contain a single host address.

Quick Conversion Methods

  • CIDR to subnet mask: Memorize common values or use the calculator above
  • Subnet mask to CIDR: Count consecutive 1-bits in binary representation
  • Calculate hosts: 2(32-prefix) – 2 (except /31 and /32)

Network Planning Shortcuts

The “256 Minus” Trick

Find subnet increment in any octet:

Increment = 256 – Mask Octet

255.255.255.192 → 256 – 192 = 64
255.255.240.0 → 256 – 240 = 16

Use this increment to count through subnets: 0, 64, 128, 192…

Host Count Quick Math

Calculate available hosts from subnet mask:

Total IPs = 2n where n = # of 0 bits

Usable = 2n – 2

/24: 8 zero bits → 28 = 256 (254 usable)
/27: 5 zero bits → 25 = 32 (30 usable)

Finding Network Addresses

  • Network address: IP AND Subnet Mask
  • Broadcast address: IP OR Wildcard Mask
  • First host: Network address + 1
  • Last host: Broadcast address – 1

Common Subnet Sizes and Uses

/24 (256 IPs, 254 hosts)

Standard subnet for small to medium networks.

  • Small office LANs
  • Home networks
  • Default router subnet
  • Enterprise building blocks

/27 to /29 (32-8 IPs)

Small segments requiring isolation.

  • Guest WiFi networks
  • VoIP phone subnets
  • IoT device isolation
  • Management networks

/30 (4 IPs, 2 hosts)

Point-to-point links.

  • Router-to-router WAN links
  • ISP customer connections
  • Metro Ethernet links
  • Fixed endpoint VPN tunnels

/31 (2 IPs, 2 hosts)

Maximum efficiency for point-to-point (RFC 3021).

  • Modern router interconnections
  • Service provider infrastructure
  • Data center network fabrics
  • Any 2-IP requirement

/32 (1 IP)

Single-host routes.

  • Loopback interfaces
  • NAT pool addresses
  • Specific service IPs
  • Host routes in routing tables

VLSM Network Planning

Variable Length Subnet Masking allows efficient address allocation by using different subnet sizes for different network segments.

Step 1: List Requirements by Size

Example requirements:

  • HQ LAN: 100 hosts
  • Branch LAN: 50 hosts
  • VoIP subnet: 20 phones
  • Point-to-point links: 5 links (2 hosts each)

Step 2: Sort by Size (Largest First)

NetworkHosts NeededNext Power of 2CIDR
HQ LAN100128 (27)/25
Branch LAN5064 (26)/26
VoIP subnet2032 (25)/27
P2P links (5)2 each4 (22) each/30 each

Step 3: Allocate Addresses Sequentially

Starting from 192.168.1.0/24:

NetworkAddress BlockUsable Range
HQ LAN192.168.1.0/25192.168.1.1 – 192.168.1.126
Branch LAN192.168.1.128/26192.168.1.129 – 192.168.1.190
VoIP subnet192.168.1.192/27192.168.1.193 – 192.168.1.222
P2P Link 1-5192.168.1.224/30 onwards2 hosts each

Documentation Best Practice

Maintain a detailed IP address plan document with:

  • All subnet assignments with CIDR notation
  • Purpose of each subnet
  • Available blocks for future use
  • VLAN and routing information

Subnet Troubleshooting Scenarios

“Can ping gateway, not other hosts”

Potential subnet issues:

  • Incorrect subnet mask on host
  • Host in different subnet than expected
  • Gateway not routing properly

Check:

  1. Verify host subnet mask matches network
  2. Confirm IP is within expected range
  3. Check both hosts are in same subnet

“Networks can’t communicate after reconfiguration”

Potential subnet issues:

  • Overlapping subnet ranges
  • Incorrect masks causing boundary confusion
  • Missing routes in router

Check:

  1. Use calculator to verify non-overlapping ranges
  2. Verify router interface subnet configuration
  3. Confirm routes exist in both directions

“New devices can’t get IP addresses”

Potential subnet issues:

  • DHCP scope doesn’t match subnet
  • Subnet out of available addresses
  • DHCP using wrong subnet mask

Resolution:

If subnet has exhausted addresses, use VLSM to redesign the network or implement a larger subnet. Verify DHCP scope aligns with actual subnet configuration.

IPv6 Subnetting Fundamentals

IPv6 Address Structure

/48

Global Routing Prefix

/64

Subnet ID

64 bits

Interface ID

Organizations typically receive a /48 prefix, providing 65,536 /64 subnets (216), each with 264 addresses.

Common IPv6 Subnet Sizes

PrefixTypical UseAvailable Subnets
/64Standard LAN/WiFi subnet1 subnet, 264 addresses
/56Small site (home, small office)256 /64 subnets
/48Typical organization65,536 /64 subnets
/127Point-to-point links2 addresses total

IPv6 vs IPv4 Planning Differences

  • No address conservation: IPv6 provides virtually unlimited addresses
  • Standard /64 subnets: Almost all endpoints use /64 regardless of host count
  • No NAT: Each device gets a public address, simplifying subnetting
  • Hexadecimal notation: Addresses use 16-bit hex groups instead of decimal octets
  • No broadcast: IPv6 uses multicast instead of broadcast addresses