Skip to main content
IP Subnet

IP Subnet Calculator

Calculate subnet mask, network address, broadcast address, and usable host range.

/0/8/16/24/32

Common subnet sizes

Network Analysis β€” 192.168.1.100/24
IP Address192.168.1.100
Subnet Mask255.255.255.0
Network Address192.168.1.0
Broadcast192.168.1.255
First Host192.168.1.1
Last Host192.168.1.254
Usable Hosts254
Total Addresses256
Class CπŸ”’ Private IP/24 = 254 usable hosts

Private IP ranges (RFC 1918)

10.0.0.0/8Class A private (large orgs)
172.16.0.0/12Class B private (medium orgs)
192.168.0.0/16Class C private (home/small office)
127.0.0.0/8Loopback (localhost)

How It Works

The IP subnet calculator computes the network address, broadcast address, usable host range, subnet mask and total number of hosts for any IPv4 address written in CIDR notation. Instead of doing the binary arithmetic by hand, you enter an address and a prefix length and instantly see exactly how the network is divided β€” which addresses are usable, where the boundaries fall, and how many devices the subnet can hold.

What it does and who it is for

This is a practical networking tool for students learning the CCNA syllabus, system and network administrators planning office or data-centre networks, developers configuring cloud VPCs and security groups, and anyone setting up a home or small-office LAN. It removes the error-prone mental maths of converting masks to binary and counting host bits, and it flags useful context such as the legacy address class and whether the address is private (RFC 1918) or public. The binary view makes it a genuine learning aid, not just an answer box.

How it works β€” CIDR and the subnet mask

CIDR (Classless Inter-Domain Routing) notation writes an IP and prefix together, for example 192.168.1.0/24. The /24 means the first 24 bits identify the network and the remaining bits identify hosts within it. The prefix maps directly to a subnet mask: a /24 is 24 binary ones followed by 8 zeros, which is 255.255.255.0. Routers compare an address against the mask to decide whether two devices sit on the same network or need routing between them. The calculator finds the network address by keeping the network bits and setting all host bits to 0, and the broadcast address by setting all host bits to 1; every address strictly between those two is a usable host.

Hosts per subnet

The number of addresses in a subnet is 2(32βˆ’prefix), and the usable host count is:

Usable hosts = 2(32βˆ’prefix) βˆ’ 2

We subtract 2 because the network address (all host bits = 0) and the broadcast address (all host bits = 1) cannot be assigned to a device. So a /24 gives 2⁸ = 256 total addresses and 256 βˆ’ 2 = 254 usable hosts; a /30, common for point-to-point router links, gives just 2Β² βˆ’ 2 = 2 usable hosts.

A worked example

Take 192.168.1.100/26. A /26 mask is 255.255.255.192, leaving 6 host bits, so each subnet holds 2⁢ = 64 addresses and 62 usable hosts. The /26 blocks start at .0, .64, .128 and .192, so .100 falls in the .64 block: the network address is 192.168.1.64, the broadcast is 192.168.1.127, the first usable host is 192.168.1.65 and the last is 192.168.1.126. The address is in the 192.168.0.0/16 range, so it is correctly reported as a private Class C address.

Classful, classless and VLSM

Older networks used fixed classes β€” Class A (/8), Class B (/16) and Class C (/24) β€” where the class alone decided how many hosts you got, regardless of need. That wasted enormous amounts of address space, so modern networks use classless subnetting, where any prefix from /0 to /32 is allowed. Variable Length Subnet Masking (VLSM) takes this further by letting you split one block into subnets of different sizes: a /24 might be carved into a /25 for a large department, two /27s for smaller teams, and a few /30s for router links, so each subnet gets just enough addresses and very little is wasted. This calculator shows the class for reference, but the network address, broadcast and host range it computes are based purely on the prefix you choose, exactly as a real router would treat them.

Tips for using it well

  • Size for need plus growth: pick the smallest prefix that covers your hosts and add 20–30% headroom.
  • Use the binary view to see exactly where the network/host boundary sits β€” it makes subnetting click.
  • Remember a larger prefix number means a smaller network (/30 is tiny; /8 is huge).
  • Reach for /30 (or /31 on modern gear) for router-to-router links to avoid wasting addresses.

Common mistakes to avoid

  • Assigning the network or broadcast address to a device β€” they are reserved and unusable.
  • Forgetting the βˆ’2 when counting capacity, so a subnet looks like it holds two more hosts than it does.
  • Confusing prefix direction: increasing the prefix shrinks the network, it does not grow it.
  • Mixing private and public ranges β€” private addresses (10/8, 172.16/12, 192.168/16) are not routable on the internet.

Frequently Asked Questions

A subnet mask identifies which part of an IP address is the network portion vs the host portion. /24 = 255.255.255.0 = 24 ones followed by 8 zeros in binary. The 1-bits cover the network, the 0-bits cover hosts. Routers use the mask to determine if two IPs are on the same network.

Part of Everyday Tools & Fun Calculators β€” compare every related calculator in one place.