Skip to content
TheCalcUniverse

IP Subnet Calculator — Free Online Calculator with Step-by-Step Guide

Calculate network address, broadcast address, usable host range, and total hosts for any IPv4 subnet. Includes binary representation and IP class detection.

✓ Tested formula & cited sources Formula verified 2026-01-15 Runs in your browser — inputs never sent anywhere

See it worked out

Example — IP Address 192.168.1.0, CIDR Prefix 24:

Network Address

192.168.1.0

Broadcast Address

192.168.1.255

Usable Host Range

192.168.1.1 — 192.168.1.254

Usable Hosts

254

Subnet Mask

255.255.255.0

CIDR Notation

/24

IP Address (Binary)

11000000.10101000.00000001.00000000

Subnet Mask (Binary)

11111111.11111111.11111111.00000000

IP Class

C

Type

Private

The formula

Network = IP & Mask | Broadcast = IP | ~Mask | Hosts = 2^(32-CIDR) - 2

IP & Mask
IP Address & Subnet Mask
CIDR
CIDR Prefix
Hosts
Usable Hosts

Worked example — IP Address 192.168.1.0, CIDR Prefix 24

Network Address = 192.168.1.0

Full explanation ↓

How IP Subnet Calculator Works

Network = IP & Mask | Broadcast = IP | ~Mask | Hosts = 2^(32-CIDR) - 2

IP subnetting divides an IP address into network and host portions using a subnet mask. The network address (all host bits = 0) is the first address in the range and identifies the subnet. The broadcast address (all host bits = 1) is the last address, used to send packets to all hosts on that subnet simultaneously. The addresses in between are available for assigning to individual devices (hosts). The subnet mask is applied to the IP address using a bitwise AND operation to extract the network portion.

IP & Mask
IP Address & Subnet MaskIP address identifies a specific network interface (e.g., 192.168.1.1). The subnet mask separates the network and host portions: 1-bits represent the network, 0-bits the host. Written as dotted decimal (255.255.255.0) or CIDR (/24).
CIDR
CIDR PrefixThe number of leading 1-bits in the subnet mask. Common values: /24 (255.255.255.0, 256 addresses), /16 (255.255.0.0, 65536 addresses), /8 (255.0.0.0, 16.7M addresses).
Hosts
Usable HostsThe number of available host addresses, calculated as 2^(32 - CIDR) - 2. We subtract 2 because the first address is reserved for the network ID and the last for the broadcast. A /24 network has 254 usable hosts.
A /24 subnet has 254 usable host addresses

How to Use

  1. Enter an IPv4 address in dotted decimal format (e.g., 192.168.1.0).
  2. Enter the CIDR prefix as a number from 0 to 32 (e.g., 24 for a /24 network).
  3. View the complete subnet breakdown including network address, subnet mask in both formats, usable host range, broadcast address, and total hosts.

Understanding the Result

Subnetting is fundamental to network engineering and CCNA certification. It allows network administrators to divide a large network into smaller, more manageable subnetworks, improving security, reducing broadcast traffic, and conserving IP address space. Understanding the binary representation is key: the subnet mask has consecutive 1-bits for the network portion and 0-bits for the host portion. For example, 255.255.255.0 in binary is 24 ones followed by 8 zeros — the first 24 bits identify the network, and the last 8 bits identify individual hosts on that network. This binary operation is why bitwise AND with the mask extracts the network address, and bitwise OR with the inverted mask produces the broadcast address. The practice of subnetting is essential for efficient IP address management in both enterprise networks and cloud infrastructure (AWS VPCs, Azure virtual networks).

Frequently Asked Questions

What is CIDR?
CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing that replaces the older classful system (Class A, B, C). Instead of fixed prefix lengths (/8, /16, /24), CIDR allows any prefix length from /0 to /32, enabling more efficient allocation of address space. For example, a /27 network has 32 addresses (30 usable) instead of the rigid 256 addresses of a Class C /24. This flexibility is why we use CIDR notation today for everything from home routers to cloud networking.
Why do we subtract 2 for host addresses?
In every subnet, two addresses are reserved and cannot be assigned to hosts. The first address (all host bits = 0) is the network address that identifies the subnet itself. The last address (all host bits = 1) is the broadcast address used to send packets to all hosts on that subnet simultaneously. For example, in a 192.168.1.0/24 network, 192.168.1.0 is the network address and 192.168.1.255 is the broadcast address, leaving 192.168.1.1 through 192.168.1.254 (254 addresses) for hosts. The exception is /31 networks (RFC 3021), which have no separate network or broadcast, so both addresses are usable for point-to-point links like router interconnects.
How do I determine the right subnet size for my network?
The right subnet size depends on how many hosts you need. A /24 supports 254 hosts (typical for small offices), a /25 supports 126, a /26 supports 62, and a /27 supports 30. For home networks, a /24 is standard. For large organizations, a /16 (65,534 hosts) might be needed. For point-to-point links, a /30 (2 usable hosts) or /31 (2 hosts without broadcast) is common. Always plan for growth — choose a subnet that can accommodate at least double your expected number of devices.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "IP Subnet Calculator — Free Online Calculator with Step-by-Step Guide." TheCalcUniverse, 2026, https://thecalcuniverse.com/engineering/ip-subnet-calculator/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like

Guides that use this calculator