The IP Subnet Calculator computes all the details of an IPv4 subnet: network address, broadcast address, first and last usable host, subnet mask, CIDR notation, number of usable hosts, and IP class โ€” from any IP address and subnet mask or CIDR prefix.

IP Subnet Calculator

Calculate network address, broadcast address, host range, and usable hosts.

Format: XXX.XXX.XXX.XXX
Subnet Information

How to Use This Calculator

  1. Enter an IP Address in dotted-decimal format (e.g., 192.168.1.0).
  2. Select the CIDR Prefix from the dropdown (e.g., /24 for a Class C network), or type the subnet mask directly.
  3. Click Calculate.

CIDR Notation Reference

  • /8 โ€” Class A | 255.0.0.0 | 16,777,214 usable hosts
  • /16 โ€” Class B | 255.255.0.0 | 65,534 usable hosts
  • /24 โ€” Class C | 255.255.255.0 | 254 usable hosts
  • /28 โ€” Small LAN | 255.255.255.240 | 14 usable hosts
  • /30 โ€” Point-to-point link | 255.255.255.252 | 2 usable hosts
  • /32 โ€” Single host | 255.255.255.255 | 1 address (no broadcast)

Key Concepts

Network address: First address in the subnet โ€” identifies the network itself. Not assignable to a host.

Broadcast address: Last address in the subnet โ€” packets sent here are delivered to all hosts. Not assignable.

Usable hosts: Total addresses minus 2 (network + broadcast), except for /31 and /32 which are special cases.

CIDR (Classless Inter-Domain Routing): The /n notation indicates how many leading bits of the address are the network portion.

Frequently Asked Questions

What is a private IP range?

RFC 1918 defines three private ranges not routable on the public internet: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Home routers typically use 192.168.0.0/24 or 192.168.1.0/24.

What is subnetting used for?

Subnetting divides a large network into smaller, more manageable segments. Benefits include reduced broadcast traffic, improved security (isolate departments), and more efficient IP address utilization.

How it works

The IP address and subnet mask are converted to 32-bit unsigned integers using bitwise operations. The network address is found with a bitwise AND of the IP and mask. The broadcast is the IP OR'd with the inverted mask. First host = network + 1, last host = broadcast โˆ’ 1 (except for /31, /32).

Formula

Network = IP & mask. Broadcast = IP | (~mask >>> 0). Usable hosts = 2^(32โˆ’prefix) โˆ’ 2