Calcumia

Free IP Subnet Calculator

Our free IP subnet calculator determines essential subnet parameters for network administrators, systems engineers, and IT students. Enter any valid IPv4 address and CIDR prefix length to instantly calculate the network ID, broadcast address, usable IP range, subnet mask, and total usable hosts. It simplifies IP allocation and routing design without the need for manual binary conversion.

Your inputs

Result

Network address
—
Subnet mask
—
First usable host
—
Last usable host
—
Broadcast
—
Usable hosts
—
Wildcard mask
—

Add this calculator to your site — free

Copy one of the snippets into your page. Please keep the attribution link visible.

How to use the IP Subnet Calculator

  1. Enter a valid 32-bit IPv4 address into the designated input field.
  2. Select or enter your desired Prefix length (CIDR) value between 0 and 32.
  3. Review the automatically calculated Network address, Subnet mask, and Wildcard mask.
  4. Use the First usable host, Last usable host, and Usable hosts count to assign addresses within your network.

How it works

The calculated results define the precise boundaries of your local network segment. The network address identifies the subnet itself, while the broadcast address allows traffic to reach every device on that specific segment. Devices are assigned addresses within the usable host range, which spans between the first and last usable host. The subnet mask and inverse wildcard mask govern routing decisions and packet filtering in access control lists.

IPv4 subnetting follows Internet Engineering Task Force (IETF) specifications, primarily RFC 791 and Classless Inter-Domain Routing (CIDR) defined in RFC 4632. Subnetting works by applying a bitwise AND operation between the 32-bit IPv4 address and the subnet mask. The prefix length specifies the exact number of leading network bits, leaving the remaining bits to address individual host interfaces dynamically across the network.

The standard host formula, 2^(32 − prefix) − 2, subtracts two addresses to reserve the network and broadcast identifiers. For example, 192.168.1.10/24 yields 254 usable hosts on network 192.168.1.0. When deploying networks, note that point-to-point links using /31 subnets under RFC 3021 do not reserve broadcast addresses, and private address blocks defined by RFC 1918 cannot be routed directly over the public internet.

Formula

Hosts = 2^(32 − prefix) − 2

Worked example

192.168.1.10/24 is in network 192.168.1.0 with 254 usable hosts.

Frequently asked questions

What does a /24 prefix length mean?+

A /24 prefix length designates that the first 24 bits of a 32-bit IPv4 address represent the network portion. This leaves 8 bits for host addressing, which provides 256 total IP addresses and 254 usable host addresses after subtracting the network and broadcast addresses.

What are the standard private IPv4 address ranges?+

Private IPv4 addresses are reserved under RFC 1918 for internal local networks and cannot be routed across the public internet. The three standard private ranges are 10.0.0.0/8 (Class A), 172.16.0.0/12 (Class B), and 192.168.0.0/16 (Class C).

Why are two host addresses subtracted in subnetting?+

In traditional IPv4 networking, two addresses per subnet are reserved for administrative purposes. The very first address with all host bits set to zero serves as the network identifier, while the final address with all host bits set to one is the local broadcast address.

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

A subnet mask uses consecutive binary ones to identify the network bits and zeros for host bits. A wildcard mask is the exact bitwise inverse, where zeros identify bits that must match and ones identify bits that can vary, commonly used in router access lists.

Can I use a /31 prefix for host devices?+

Standard subnets require at least a /30 prefix to support two hosts. However, RFC 3021 permits /31 subnets exclusively for point-to-point links between two routers, eliminating the traditional requirement for dedicated network and broadcast addresses to conserve IPv4 space.

✓ Written and reviewed by the Calcumia editorial team · Last updated: · How we build and check our calculators

Results are estimates for information only and are not financial, medical or legal advice.