IPv4 Subnet Calculator

Calculate network, broadcast, and host range from CIDR notation

Examples:

The IPv4 Subnet Calculator takes any IPv4 address with CIDR notation and instantly computes the network address, broadcast address, subnet mask, usable host range, and total host count. Enter a value like 192.168.1.0/24 or 10.0.0.1/16 to get complete subnet details.

Understanding Subnetting

If you manage servers, switches, or firewalls, subnetting is one of the first things you need to get right. Every device on an IP network belongs to a subnet, and the subnet defines which other devices it can talk to directly. Get the boundaries wrong and traffic silently disappears, DHCP hands out addresses that collide, or firewall rules open the wrong range.

A subnet is just a contiguous block of IP addresses that share the same network prefix. When you write 192.168.1.0/24, the /24 means the first 24 bits are the network portion and the remaining 8 bits identify individual hosts. That single notation tells you the subnet mask (255.255.255.0), the range of usable addresses (.1 through .254), and the broadcast address (.255) -- all without doing any math yourself.

This calculator does that math for you. You give it any IP and prefix length, and it returns every detail you need: network address, broadcast address, subnet mask in dotted decimal, first and last usable host, and total host count. Whether you are carving a /16 campus network into VLANs or sizing a /28 DMZ for a handful of servers, the output tells you exactly what range you are working with.

How to Calculate IPv4 Subnets from CIDR Notation

  1. Enter an IPv4 address with a CIDR prefix length (e.g., 192.168.1.100/24)
  2. The calculator performs a bitwise AND between the IP and subnet mask to derive the network address
  3. Host bits are set to all 1s to compute the broadcast address
  4. The first usable host (network + 1) and last usable host (broadcast - 1) define the host range
  5. Results display the subnet mask in dotted decimal, total addresses, and usable host count

IPv4 Subnet Calculation Examples

InputNetwork AddressBroadcast AddressSubnet MaskUsable Hosts
192.168.1.100/24192.168.1.0192.168.1.255255.255.255.0254
10.0.0.1/810.0.0.010.255.255.255255.0.0.016,777,214
172.16.5.130/20172.16.0.0172.16.15.255255.255.240.04,094
192.168.10.50/28192.168.10.48192.168.10.63255.255.255.24014
10.1.1.1/3010.1.1.010.1.1.3255.255.255.2522
172.16.0.1/16172.16.0.0172.16.255.255255.255.0.065,534

When to Use This Tool

  • Planning new network segments -- determine the correct prefix length for the number of hosts you need
  • Configuring routers and firewalls -- verify network and broadcast addresses before writing rules
  • Setting up DHCP scopes -- identify the usable host range for address assignment
  • Troubleshooting connectivity -- confirm that two devices are on the same subnet
  • Documenting infrastructure -- record accurate network boundaries for each VLAN or segment
  • Validating firewall rules -- ensure ACLs reference the correct network address

How IPv4 Subnetting Works

Bitwise AND Operation

Subnetting divides an IPv4 address into a network portion and a host portion using a subnet mask. The network address is found by performing a bitwise AND between the IP address and the mask.

For 192.168.1.100/24:

IP Address:   11000000.10101000.00000001.01100100  (192.168.1.100)
Subnet Mask:  11111111.11111111.11111111.00000000  (255.255.255.0)
              ──────────────────────────────────────
Network Addr: 11000000.10101000.00000001.00000000  (192.168.1.0)

Common Prefix Lengths

PrefixSubnet MaskTotal AddressesUsable HostsTypical Use
/8255.0.0.016,777,21616,777,214Large enterprise or ISP blocks
/16255.255.0.065,53665,534Campus or site-level allocation
/24255.255.255.0256254Standard LAN segment
/28255.255.255.2401614Small department or DMZ
/30255.255.255.25242Point-to-point router links
/32255.255.255.25511Single host route (loopback)

Reserved Addresses in Every Subnet

Every IPv4 subnet reserves two addresses that cannot be assigned to hosts:

  • Network address -- all host bits set to 0, identifies the subnet itself
  • Broadcast address -- all host bits set to 1, used to send traffic to all hosts on the segment

The exception is /31 subnets (RFC 3021), which eliminate the broadcast address for point-to-point links, yielding 2 usable addresses from 2 total.

Subnetting in Practice

The most common mistake in subnet planning is sizing too tightly. A subnet that fits your current device count with no room to spare will cause problems the moment you add a printer, an access point, or a monitoring appliance. As a general rule, pick a prefix length that gives you at least 30-50% headroom beyond your current count. If you have 80 devices on a floor, a /25 (126 usable hosts) works today but a /24 (254 usable hosts) gives you room for the next two years of growth without re-addressing.

The second most common mistake is subnetting without a plan. It is tempting to hand out /24 blocks to every department, but that wastes address space in small offices and creates fragmented routing tables. Start with your largest allocation (maybe a /16 from RFC 1918 space) and divide it hierarchically: sites get /20 or /22 blocks, buildings get /23 or /24 blocks within those, and individual VLANs get /25 or /26 blocks as needed. This structure keeps your routing tables clean and makes it easy to summarize routes at each aggregation point.

Point-to-point links between routers are a special case. These links only connect two interfaces, so a /30 (2 usable hosts) or /31 (2 usable hosts with no broadcast) is the correct choice. Using a /24 for a WAN link wastes 252 addresses and can confuse junior engineers who see the gap in the address plan.

Frequently Asked Questions

How many usable hosts does a /24 subnet have?

A /24 subnet contains 256 total addresses (2^8). Two are reserved: the network address (e.g., 192.168.1.0) and the broadcast address (e.g., 192.168.1.255). That leaves 254 usable host addresses, from .1 through .254. This is the most common subnet size for LANs and VLANs.

What is the difference between /24 and 255.255.255.0?

They are two notations for the same thing. /24 is CIDR (Classless Inter-Domain Routing) notation indicating 24 network bits. 255.255.255.0 is the same mask in dotted decimal format. CIDR notation is more compact and is the standard in modern configurations, while dotted decimal is still used in older equipment and some Cisco IOS commands.

Can I subnet on non-octet boundaries like /20 or /28?

Yes. CIDR allows subnetting at any bit position from /1 to /32. A /20 splits the third octet, giving you 4,094 usable hosts. A /28 provides 14 usable hosts. The calculator handles all prefix lengths and shows the exact boundaries regardless of where the split falls.

What is the right subnet size for my network?

Choose a prefix length that covers your current device count plus 30-50% growth. For 100 devices, a /25 (126 usable hosts) is tight, while a /24 (254 usable hosts) offers comfortable room. For just two routers on a WAN link, a /30 or /31 is the standard choice.

What are RFC 1918 private address ranges?

RFC 1918 reserves three blocks for private use: 10.0.0.0/8 (16.7 million addresses), 172.16.0.0/12 (1 million addresses), and 192.168.0.0/16 (65,536 addresses). These ranges are not routed on the public internet, making them the standard choice for internal networks behind NAT. Most organizations use 10.0.0.0/8 because it provides the most space for hierarchical subnet plans.

Why does my host count not match what I expected?

The most likely cause is forgetting the two reserved addresses. A /24 has 256 total addresses but only 254 usable hosts, because the network address and broadcast address cannot be assigned to devices. For very small subnets this is significant: a /29 has 8 total addresses but only 6 usable hosts, a /30 has 4 total but only 2 usable.

Related Tools

IPparseβ€’Free Network & Subnet Calculator Tools

Β© 2026 IPparse. All tools run locally in your browser.

100% Privacy-First β€’ No Data Collected