Subnet Calculator

Calculate network address, broadcast address, usable IP range, wildcard mask, and total hosts from any IP address and CIDR subnet mask. Used daily by network engineers, IT administrators, and students studying for their Cisco CCNA certification.

Subnet calculator showing network address, broadcast, and host range

What Is Subnetting?

Subnetting is the process of dividing a large IP network into smaller, more manageable segments called subnets. Each subnet operates as its own mini-network within the larger network, with its own network address, broadcast address, and range of usable host addresses.

Think of subnetting like dividing a large building into separate offices. Each office (subnet) has its own door number (network address), intercom (broadcast), and room numbers (host addresses). People within the same office can talk freely, but they need to go through the main hallway (router) to reach a different office.

Subnetting provides three key benefits:

  • Better performance — smaller broadcast domains mean less network noise and faster communication
  • Improved security — devices on one subnet can't directly see devices on another without going through a router/firewall
  • Efficient IP allocation — instead of wasting thousands of addresses on a small network, you can carve out exactly the size you need

How the Subnet Calculator Works

When you enter an IP address and select a CIDR prefix length (like /24), the calculator performs these operations:

  1. Converts the IP to binary — each of the four octets becomes an 8-bit binary number (32 bits total)
  2. Applies the subnet mask — the mask determines which bits are the network portion (1s) and which are the host portion (0s). A /24 mask means 24 network bits and 8 host bits
  3. Calculates the network address — performs a bitwise AND between the IP and subnet mask. This zeros out all host bits
  4. Calculates the broadcast address — sets all host bits to 1
  5. Determines the usable range — the first usable host is network address + 1, the last is broadcast - 1
  6. Counts total hosts — 2^(host bits) - 2 (minus network and broadcast addresses)
Pro Tip: The two addresses you "lose" in every subnet are the network address (all host bits = 0) and broadcast address (all host bits = 1). A /24 subnet has 256 total addresses but only 254 usable hosts. A /30 has 4 addresses but only 2 usable — perfect for point-to-point router links.

Complete CIDR Reference Table

CIDRSubnet MaskWildcardTotal AddressesUsable HostsCommon Use
/8255.0.0.00.255.255.25516,777,21616,777,214Class A default
/12255.240.0.00.15.255.2551,048,5761,048,574Large enterprise
/16255.255.0.00.0.255.25565,53665,534Class B default
/20255.255.240.00.0.15.2554,0964,094Campus/building
/22255.255.252.00.0.3.2551,0241,022Large office floor
/24255.255.255.00.0.0.255256254Home network, small office
/25255.255.255.1280.0.0.127128126Department subnet
/26255.255.255.1920.0.0.636462Small department
/27255.255.255.2240.0.0.313230Server VLAN
/28255.255.255.2400.0.0.151614DMZ, small segment
/29255.255.255.2480.0.0.786Small server cluster
/30255.255.255.2520.0.0.342Point-to-point link
/31255.255.255.2540.0.0.122*RFC 3021 P2P link
/32255.255.255.2550.0.0.011Host route / loopback

* /31 subnets use both addresses as hosts per RFC 3021 — no network or broadcast address.

Private IP Address Ranges

These ranges are reserved for private networks (defined by RFC 1918) and are not routable on the public internet. Your home router uses one of these ranges internally, with NAT translating to your public IP.

RangeCIDRClassTotal AddressesTypical Use
10.0.0.0 — 10.255.255.25510.0.0.0/8A16,777,216Large enterprise, ISP (Xfinity/Comcast)
172.16.0.0 — 172.31.255.255172.16.0.0/12B1,048,576Medium enterprise, Docker defaults
192.168.0.0 — 192.168.255.255192.168.0.0/16C65,536Home routers (most common)

Subnetting Examples

Example 1: Home Network (/24)

Most home routers use 192.168.1.0/24:

  • Network: 192.168.1.0
  • Router (gateway): 192.168.1.1
  • Usable range: 192.168.1.1 — 192.168.1.254
  • Broadcast: 192.168.1.255
  • 254 devices — more than enough for any home

Example 2: Splitting a /24 into Four /26 Subnets

A company needs 4 departments on separate subnets from 192.168.1.0/24:

SubnetNetworkUsable RangeBroadcastHosts
1st /26192.168.1.0.1 — .62192.168.1.6362
2nd /26192.168.1.64.65 — .126192.168.1.12762
3rd /26192.168.1.128.129 — .190192.168.1.19162
4th /26192.168.1.192.193 — .254192.168.1.25562

Example 3: Point-to-Point Link (/30)

Router-to-router connections only need 2 IPs. A /30 is perfect:

  • Network: 10.0.0.0
  • Router A: 10.0.0.1
  • Router B: 10.0.0.2
  • Broadcast: 10.0.0.3

How to Subnet on the Command Line

Windows — Finding Your Current Subnet

ipconfig

Look for Subnet Mask under your active adapter. It's usually 255.255.255.0 (/24) on home networks.

Linux / Mac — Check Subnet

ifconfig | grep netmask

Or with the newer ip command:

ip addr show | grep inet

The output shows CIDR notation directly, like inet 192.168.1.100/24.

Configuring a Subnet on Your Router

Log into your router's admin panel, go to LAN settings, and you'll see the subnet mask field. Most home users should leave it at 255.255.255.0 (/24). Only change it if you're deliberately segmenting your network with VLANs.

Pro Tip: When setting static IPs, always use addresses within your subnet's usable range and outside the DHCP pool. For a /24 network, a common approach is DHCP assigns .100-.200 and static devices use .2-.99 or .201-.254.

Subnet Mask Quick Math

The fastest way to subnet in your head: for each CIDR increase by 1, you halve the number of hosts.

CIDRHostsBlock SizeMemory Aid
/24254256Full C-class
/25126128Half
/266264Quarter
/273032Eighth
/281416Sixteenth
/2968Thirty-second
/3024Point-to-point

The block size (also called increment) tells you where each subnet starts. For /26 (block size 64): subnets start at .0, .64, .128, .192.

Video Tutorial

Key Takeaways

  • A /24 subnet (255.255.255.0) provides 254 hosts — standard for home networks
  • Each CIDR increase by 1 halves the available hosts
  • Every subnet reserves 2 addresses: network (first) and broadcast (last)
  • Private IPs (10.x, 172.16-31.x, 192.168.x) are not routable on the internet
  • The wildcard mask is the inverse of the subnet mask — used in ACLs and OSPF
  • Use /30 for point-to-point links and /32 for single-host routes

Related Tools & Guides

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation represents a subnet mask as a slash followed by the number of network bits. For example, /24 means the first 24 bits are the network portion, equivalent to the subnet mask 255.255.255.0. It replaced the old class-based system (Class A, B, C) to allow more flexible address allocation.

How many hosts can a /24 subnet support?

A /24 subnet has 256 total addresses and 254 usable hosts. The formula is 2^(32-24) - 2 = 254. The two excluded addresses are the network address (192.168.1.0) and broadcast address (192.168.1.255), which cannot be assigned to individual devices.

What is the difference between a subnet mask and a wildcard mask?

A wildcard mask is the bitwise inverse of a subnet mask. Where the subnet mask has 1s, the wildcard has 0s, and vice versa. For example, subnet mask 255.255.255.0 has wildcard 0.0.0.255. Wildcard masks are used in Cisco access control lists (ACLs) and OSPF routing configurations.

Why do we subtract 2 from the total hosts?

Every subnet reserves two addresses that cannot be assigned to devices: the network address (all host bits set to 0, identifies the subnet itself) and the broadcast address (all host bits set to 1, used to send data to all devices on the subnet simultaneously).

What subnet should I use for my home network?

Use /24 (255.255.255.0). It provides 254 addresses, which is more than enough for any home. Most routers default to this. There's no benefit to using a larger subnet at home — it just increases the broadcast domain unnecessarily.

Can two subnets overlap?

Subnets must not overlap if they're on the same network — overlapping ranges cause IP address conflicts and routing errors. When planning subnets, use this calculator to verify that each subnet's range doesn't overlap with another. The block size makes this easy to check.

About Tommy N.

Tommy is the founder of RouterHax and a network engineer with 10+ years of experience in home and enterprise networking. He specializes in router configuration, WiFi optimization, and network security. When not writing guides, he's testing the latest mesh WiFi systems and helping readers troubleshoot their home networks.

Promotion for FREE Gifts. Moreover, Free Items here. Disable Ad Blocker to get them all.

Once done, hit any button as below