🌐 IPv4 Subnet Calculator

Calculate CIDR ranges, masks, and host details instantly in your browser.

Last updated: June 9, 2026 · By Λ

Prefix Length /24
Enter an IPv4 address and prefix to calculate subnet details.
Tip: You can use this for VPC planning, firewall rules, ACL debugging, DHCP scopes, and route validation.

What is an IPv4 Subnet Calculator?

An IPv4 subnet calculator helps you understand how an IP address fits inside a network range. Given an address and prefix length, it calculates the network ID, broadcast address, subnet mask, wildcard mask, host range, and number of available hosts. This removes manual binary math and reduces mistakes during network design and troubleshooting.

Subnet calculations are used daily by network engineers, cloud teams, DevOps engineers, and security analysts. Whether you are configuring a VPC subnet, writing ACLs, setting up DHCP pools, or checking route overlap, accurate CIDR math is essential. One wrong subnet can cause inaccessible services, traffic leaks, or conflicting routes.

Every result row comes from the script embedded in this page, so the addresses you type stay on your machine and out of anyone's server logs. You can quickly test ranges, compare prefixes like /24 versus /27, and verify exact boundaries before applying production changes.

How to Use This Tool

  1. Enter an IPv4 address, for example 10.0.12.34 or 192.168.1.10.
  2. Use the prefix slider to choose the CIDR length from /0 to /32.
  3. Click Calculate, or wait for auto-calc while typing.
  4. Review network details including network address, broadcast, usable host range, and mask values.
  5. Use the results to validate firewall scopes, routing entries, and subnet plans.

Key Features

How the calculator does the math

The script packs your four octets into one 32-bit integer, builds the mask by shifting 0xffffffff left by 32 minus the prefix, and derives the rest bitwise: network is address AND mask, wildcard is NOT mask, broadcast is network OR wildcard. Host counts come from 2 to the power of (32 minus prefix), minus the two reserved addresses, with special handling at /31 and /32. Results refresh roughly 300 milliseconds after you stop typing, so the Calculate button mostly exists for emphasis.

Worked examples

Press Load Sample and the form fills with 192.168.10.24/24. The grid reports mask 255.255.255.0, wildcard 0.0.0.255, network 192.168.10.0, broadcast 192.168.10.255, hosts 192.168.10.1 through 192.168.10.254, 256 total addresses with 254 usable, Class C, Private (RFC1918).

Now try 10.0.12.34/27. The block size is 32, so the network snaps to 10.0.12.32, broadcast is 10.0.12.63, and hosts run 10.0.12.33 to 10.0.12.62: 30 usable out of 32. That snap-to-boundary check matters before carving a VPC into /27s.

Limitations and edge cases

The Address Type row only recognizes the three RFC1918 blocks, so loopback 127.0.0.1, link-local 169.254.x.x, and CGNAT 100.64.0.0/10 all come back as "Public or special-use". Class D and E inputs still get a host range even though multicast and reserved space have none in practice. Octets with leading zeros, like 010, parse as decimal 10 here, while some older network stacks treat them as octal. At /0 the grid reports all 4294967296 addresses, correct but rarely what you meant.

Frequently Asked Questions

What is CIDR notation?

CIDR expresses a subnet as an IP plus prefix length, such as 192.168.1.0/24. The prefix indicates how many leading bits are fixed as the network portion.

How many hosts are in a /24?

A /24 has 256 total addresses. In traditional subnetting, 254 are usable host addresses because one is network and one is broadcast.

Why are /31 and /32 special?

/31 is often used for point-to-point links and effectively provides two usable endpoints. /32 represents a single host route.

Does this support IPv6?

This page is focused on IPv4 only. IPv6 subnetting uses different address size and notation rules.

Related tools