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

Sources

  1. Fuller, V. & Li, T. RFC 4632: Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan. IETF / RFC Editor, 2006.
  2. Mogul, J. & Postel, J. RFC 950: Internet Standard Subnetting Procedure. IETF / RFC Editor, 1985.
  3. Retana, A., White, R., Fuller, V. & McPherson, D. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links. IETF / RFC Editor, 2000.
  4. Hinden, R. & Deering, S. RFC 4291: IP Version 6 Addressing Architecture. IETF / RFC Editor, 2006.
  5. Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G. & Lear, E. RFC 1918: Address Allocation for Private Internets. IETF / RFC Editor, 1996.

Formula

IPv4 network address: $$ Network = IP \;\text{AND}\; Mask $$IPv4 broadcast address: $$ Broadcast = Network \;\text{OR}\; Wildcard $$Wildcard mask: $$ Wildcard = 255.255.255.255 – Mask $$CIDR subnet mask rule: $$ Mask = p \text{ leading 1-bits followed by } (32-p) \text{ trailing 0-bits} $$Total IPv4 addresses in a subnet: $$ Total = 2^{\,32-p} $$Usable IPv4 hosts: $$ Usable = \begin{cases} 2^{\,32-p} – 2, & p \le 30 \\ 2, & p = 31 \\ 1, & p = 32 \end{cases} $$First usable host: $$ First = \begin{cases} Network + 1, & p \le 30 \\ Network, & p \ge 31 \end{cases} $$Last usable host: $$ Last = \begin{cases} Broadcast – 1, & p \le 30 \\ Broadcast, & p \ge 31 \end{cases} $$New prefix when dividing by subnet count: $$ p_{new} = p_{old} + \left\lceil \log_2(S) \right\rceil $$Subnet count produced by a new prefix: $$ Subnets = 2^{\,p_{new} – p_{old}} $$Addresses per new subnet: $$ SubnetSize = 2^{\,32-p_{new}} $$New prefix when dividing by required hosts per subnet: $$ p_{new} = 32 – \left\lceil \log_2(H + 2) \right\rceil $$IPv6 total addresses in a prefix: $$ Total_{IPv6} = 2^{\,128-p} $$Where: $$ p = \text{prefix length} $$ $$ S = \text{required number of subnets} $$ $$ H = \text{required hosts per subnet} $$

Embed This Calculator

Copy the code and paste it into your website:

<!-- IP Subnet Calculator from CalculateQuick.com -->
<iframe src="https://calculatequick.com/embed/ip-subnet/" width="100%" height="600" style="border:none;" referrerpolicy="no-referrer-when-downgrade" title="IP Subnet Calculator"></iframe>
<p style="font-size:14px;text-align:center;margin-top:8px;"><a href="https://calculatequick.com/technology/ip-subnet-calculator/">IP Subnet Calculator</a> by <a href="https://calculatequick.com">CalculateQuick</a></p>

Tip: Adjust height="600" if needed.

WordPress

  1. Edit the page or post
  2. Add a “Custom HTML” block
  3. Paste the embed code
  4. Update/Publish

Wix

  1. Click Add (+) → Embed Code → Embed HTML
  2. Paste the code
  3. Publish

Squarespace

  1. Add a Code block
  2. Paste the code
  3. Save

Shopify

  1. Online Store → Pages → Show HTML
  2. Paste the code
  3. Save

Webflow

  1. Add an Embed element
  2. Paste the code
  3. Publish

HTML

  1. Paste into your HTML file
  2. Upload to server

Cite This Calculator

CalculateQuick. (2026). IP Subnet Calculator. Retrieved from https://calculatequick.com/technology/ip-subnet-calculator/
"IP Subnet Calculator." CalculateQuick, 2026, https://calculatequick.com/technology/ip-subnet-calculator/.
CalculateQuick. "IP Subnet Calculator." Accessed April 3, 2026. https://calculatequick.com/technology/ip-subnet-calculator/.

Share

Send Feedback

Found a bug? Have a suggestion? Let us know.

Thank you for your feedback!

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