Skip to main content

Subnet Calculator Calculate subnet details from IP address and CIDR prefix — network, broadcast, host range, and mask.

Subnet Calculator illustration
🔢

Subnet Calculator

Calculate subnet details from IP address and CIDR prefix — network, broadcast, host range, and mask.

1

Enter IP Address

Input an IPv4 address (e.g., 192.168.1.0).

2

Set CIDR Prefix

Use the slider or buttons to set the prefix length (/0 to /32).

3

View Subnet Details

See network address, broadcast, host range, mask, and binary representation.

Loading tool...

What Is Subnet Calculator?

The Subnet Calculator analyzes an IPv4 address with CIDR prefix notation to display complete subnet information. Given an IP address and prefix length (e.g., 192.168.1.0/24), it calculates the network address, broadcast address, subnet mask, wildcard mask, first and last usable host addresses, number of usable hosts, IP class, and whether it's a private address. It also shows both the IP and mask in binary notation. The interactive CIDR slider and quick-select buttons for common prefix lengths make subnetting fast and intuitive.

Why Use Subnet Calculator?

  • Complete subnet information from IP + CIDR input
  • Interactive CIDR slider with quick-select buttons
  • Shows binary representation of IP and mask
  • Identifies IP class and private/public status

Common Use Cases

Network Design

Plan IP address allocation and subnet sizing for networks.

Firewall Rules

Determine correct network/mask for ACLs and firewall rules.

Troubleshooting

Verify subnet configuration and identify connectivity issues.

Education

Learn subnetting concepts with visual binary representation.

Technical Guide

Subnet calculations use bitwise operations on 32-bit integers. Subnet Mask = ~0 << (32 - prefix) (left-shift all-ones to zero out host bits). Network Address = IP AND Mask. Broadcast Address = Network OR (NOT Mask). First Host = Network + 1 (for prefix < 31). Last Host = Broadcast - 1. Usable Hosts = 2^(32-prefix) - 2 (for prefix ≤ 30). Special cases: /31 has 2 hosts (point-to-point links per RFC 3021), /32 has 1 host (single address). IP Classes: A (0-127), B (128-191), C (192-223), D (224-239, multicast), E (240-255, reserved). Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.

Tips & Best Practices

  • 1
    Common subnets: /24 = 254 hosts, /16 = 65,534 hosts, /8 = 16.7M hosts
  • 2
    Always reserve network and broadcast addresses — they are not usable for hosts
  • 3
    Use /30 or /31 for point-to-point links between routers
  • 4
    Private IP ranges (10.x, 172.16-31.x, 192.168.x) are not routable on the internet

Related Tools

Frequently Asked Questions

Q What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation uses IP/prefix (e.g., 192.168.1.0/24) where the prefix indicates how many bits are the network portion. /24 = 255.255.255.0 mask.
Q How many hosts can a /24 subnet have?
254 usable hosts (2^8 - 2 = 256 - network address - broadcast address = 254).
Q What is the difference between network and broadcast address?
The network address (all host bits = 0) identifies the subnet. The broadcast address (all host bits = 1) reaches all hosts on the subnet. Neither is assignable to a host.
Q What is a wildcard mask?
The wildcard mask is the inverse of the subnet mask (NOT operation). It is used in Cisco ACLs and OSPF configurations. For /24: subnet mask = 255.255.255.0, wildcard = 0.0.0.255.
Q What are private IP addresses?
Private IPs are reserved for internal networks: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. They are not routable on the public internet.

About This Tool

Subnet Calculator is a free online tool by FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration or installation required.