IP Subnet Calculator

·

·

IP Subnet Calculator

Calculate network details, host ranges, subnet masks, and more with this comprehensive subnet calculator.

Enter an IP address with CIDR prefix (e.g., 192.168.1.1/24)
Enter an IPv6 address with CIDR prefix (e.g., 2001:db8::/64)

Network Information

Basic Information

IP Address:
Network Address:
Broadcast Address:
First Host Address:
Last Host Address:
CIDR Notation:

Network Details

IP Class:
Type:
Subnet Mask:
Wildcard Mask:
Mask Bits:
Total Hosts:
Usable Hosts:

Additional Representations

Integer ID:
Hex ID:
in-addr.arpa:
IPv6 Mapped:

Binary Representation

IP Address:
Subnet Mask:
Network Address:
Broadcast Address:

Visual Network Map

IP Address Distribution in this Subnet
Network
Usable Host Range
Broadcast

Subnet Division Tool

SubnetNetwork AddressMaskRangeBroadcastUsable Hosts

IPv6 Information

Full Address:
Expanded Address:
Prefix Length:

Network Details

Network Range:
Address Type:
Total Addresses:
Results copied to clipboard
Copied to clipboard

How to Use This Subnet Calculator

This calculator provides comprehensive subnet information for both IPv4 and IPv6 addresses. Here’s how to get the most out of it:

1. Choose Your IP Version

Toggle between IPv4 and IPv6 using the tabs at the top of the calculator.

For IPv4:

  • CIDR Notation: Enter an address like 192.168.1.0/24
  • Decimal Notation: Enter an IP address and subnet mask separately

For IPv6:

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

2. Analyze Results

After clicking Calculate, you’ll get:

  • Network and broadcast addresses
  • Usable host range
  • Subnet information including mask and wildcard mask
  • Binary representations of addresses
  • Additional formats (hex, in-addr.arpa)

3. Subnet Division (IPv4)

After calculating an IPv4 subnet, you can split it into smaller subnets:

  1. Use the “Subnet Division Tool” at the bottom of the results
  2. Choose to divide by number of subnets or hosts per subnet
  3. Enter your desired value and click “Calculate Subnets”
  4. The tool will display a table with all resulting subnets

CIDR vs. Subnet Masks

Convert quickly between CIDR notation and subnet masks with this reference table:

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 have 2 usable addresses (no network/broadcast per RFC 3021). /32 networks contain just one host.

Quick Conversion Methods

  • CIDR to subnet mask: Use the calculator above or memorize common masks
  • Subnet mask to CIDR: Count the number of consecutive 1-bits in binary
  • Calculate hosts: 2(32-prefix) – 2 (or without -2 for /31 and /32)

Subnet Cheat Sheet – Shortcuts for Network Engineers

The “256 Minus Mask Octet” Trick

To find the subnet increment in any octet:

Subnet Increment = 256 – Mask Octet Value

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, etc.

Host Count Quick Math

To find the number of hosts from a subnet mask:

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

Usable Hosts = 2n – 2

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

Finding Network/Broadcast 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

/24 (256 IPs, 254 hosts)

The workhorse subnet for small to medium networks.

  • Small office LANs
  • Home networks
  • Default subnet size in many routers
  • Standard building block in enterprise networks

/27 to /29 (32-8 IPs, 30-6 hosts)

Ideal for small segments requiring isolation.

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

/30 (4 IPs, 2 hosts)

Perfect for point-to-point links.

  • Router-to-router WAN links
  • ISP customer connections
  • Metro Ethernet links
  • VPN tunnels with fixed endpoints

/31 (2 IPs, 2 hosts)

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

  • Modern router interconnections
  • Service provider infrastructure
  • Data center network fabrics
  • Any link requiring only 2 IPs

/32 (1 IP)

Single-host routes.

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

Planning Networks with VLSM

Step 1: List Requirements by Size

Example network 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 Networks by Size (Largest First)

NetworkHosts NeededNext Power of 2CIDR Prefix
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 BlockRange
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 1192.168.1.224/30192.168.1.225 – 192.168.1.226
P2P Link 2192.168.1.228/30192.168.1.229 – 192.168.1.230
P2P Link 3192.168.1.232/30192.168.1.233 – 192.168.1.234
P2P Link 4192.168.1.236/30192.168.1.237 – 192.168.1.238
P2P Link 5192.168.1.240/30192.168.1.241 – 192.168.1.242

Step 4: Verify No Overlaps and Complete Allocation

Use the subnet calculator to verify that all networks have the proper size and that there are no overlaps between assigned ranges. Note that we’ve used 244 addresses out of our /24 (256 addresses), leaving 12 addresses (three /30 subnets) available for future use.

Pro Tip: Document Your Address Plan

Keep a detailed IP address plan document that includes:

  • All subnet assignments with CIDR notation
  • Purpose of each subnet
  • Available address blocks for future use
  • VLANs and routing information if applicable

This documentation is invaluable for troubleshooting and planning network expansions.

Subnet Troubleshooting

Scenario 1: “I can ping the gateway but not other hosts”

Potential subnet issues:

  • Host using incorrect subnet mask
  • Host may be in different subnet than expected
  • Gateway not routing between subnets properly

Check steps:

  1. Verify host’s configured subnet mask matches the network
  2. Confirm IP address falls within expected subnet range
  3. Check if both hosts are actually in the same subnet

Scenario 2: “Two networks can’t communicate after reconfiguration”

Potential subnet issues:

  • Overlapping subnet ranges
  • Incorrect subnet masks causing confusion about network boundaries
  • Route missing in router

Check steps:

  1. Use subnet calculator to verify both networks have non-overlapping ranges
  2. Check router interfaces for correct subnet configuration
  3. Verify routes exist in both directions

Scenario 3: “New devices can’t get IP addresses”

Potential subnet issues:

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

Check steps:

  1. Verify DHCP scope matches the actual subnet configuration
  2. Check available addresses in DHCP pool
  3. Compare DHCP server subnet mask with network subnet mask

Resolution example:

If subnet has run out of addresses, use VLSM to redesign the network or implement a larger subnet.

IPv6 Subnetting

IPv6 Address Structure

/48

Global Routing Prefix

/64

Subnet ID

64 bits

Interface ID

Most organizations receive a /48 prefix, giving 65,536 /64 subnets (216), each with 264 addresses.

Common IPv6 Subnet Sizes

PrefixTypical UseAvailable Subnets
/64Standard subnet for LANs, WiFi networks1 subnet with 264 addresses
/56Small site assignment (home, small office)256 /64 subnets
/48Typical organization assignment65,536 /64 subnets
/127Point-to-point links (like IPv4 /30)2 addresses total

IPv6 Subnet Planning Differences

  • No address conservation – IPv6 has 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 octets
  • No broadcast addresses – IPv6 uses multicast instead