Home › Tools › IPv4 Subnet Calculator & CIDR Mask Reference

IPv4 Subnet Calculator & CIDR Mask Reference

Free online IPv4 subnet calculator. Calculate network addresses, broadcast addresses, usable host ranges, and wildcard masks instantly with CIDR notation.

Enter an IPv4 host or network address.

Select the prefix length.

Common Presets:
Subnet Calculations
Network Address
192.168.1.0
Broadcast Address
192.168.1.255
Subnet Mask
255.255.255.0
Wildcard Mask
0.0.0.255
Usable Range
192.168.1.1 - 192.168.1.254
Usable Hosts
254
Total IPs
256
Class
Class C
CIDR
192.168.1.0/24

Overview of IPv4 Subnetting

An Internet Protocol Version 4 (IPv4) address is a 32-bit numerical identifier typically written as four decimal octets separated by periods (for example, 192.168.1.1). Subnetting is the practice of logically dividing a physical IP network into smaller, manageable sub-networks (subnets).

By segmenting an IP network into subnets, systems administrators improve network routing efficiency, reduce broadcast storm overhead, and enforce stricter security boundaries between departments, servers, and demilitarized zones (DMZs).


How to Use This Subnet Calculator

  1. Enter Your IPv4 Address: Type in any valid unicast or private IPv4 address (e.g., 192.168.1.1 or 10.0.0.1).
  2. Select CIDR Prefix: Choose the Classless Inter-Domain Routing prefix (from /0 down to /32) from the dropdown, or pick one of the quick preset buttons for common architectures (/24, /16, /28, etc.).
  3. Inspect Output Specifications: The tool immediately recalculates the network base address, broadcast address, netmask, wildcard mask, and usable host range in real time.
  4. Copy Results: Click the COPY button next to any value to copy it directly into your terminal or router configuration script.

The Subnetting Formula & Bitmask Logic

Every IPv4 address consists of two parts: the Network ID and the Host ID. The subnet mask dictates where the network portion ends and the host portion begins:

Total Addresses=2(32−CIDR)\text{Total Addresses} = 2^{(32 - \text{CIDR})}

Usable Hosts=2(32−CIDR)−2\text{Usable Hosts} = 2^{(32 - \text{CIDR})} - 2

Why subtract 2?
In standard IPv4 networking, two addresses in every subnet are strictly reserved:

  1. Network Address: The all-zeros host address (identifies the subnet itself).
  2. Broadcast Address: The all-ones host address (used to packet-broadcast to every host on that specific subnet). (Exception: /31 subnets defined by RFC 3021 for point-to-point links allow 2 usable host addresses without broadcast).

Bitwise Calculation Process:

  • Network Address: Performed via bitwise AND between the 32-bit IP address and the 32-bit Subnet Mask:
    Network = IP & SubnetMask
  • Broadcast Address: Performed via bitwise OR between the Network Address and the Wildcard (inverted) mask:
    Broadcast = Network | (~SubnetMask)

Standard CIDR Subnet Cheat Sheet

CIDR PrefixSubnet MaskTotal AddressesUsable HostsCommon Use Case
/30255.255.255.25242Point-to-point router uplinks
/29255.255.255.24886Small server racks, DMZ subnets
/28255.255.255.2401614Small office branches
/27255.255.255.2243230Department subnets
/26255.255.255.1926462Large VLANs
/24255.255.255.0256254Standard Class C LAN / Home WiFi
/16255.255.0.065,53665,534Enterprise infrastructure, Cloud VPCs

Frequently Asked Questions (FAQ)

What is the difference between a Subnet Mask and a Wildcard Mask?

A Subnet Mask uses contiguous 1s from the left to denote the network prefix and 0s for the host portion (e.g., 255.255.255.0). A Wildcard Mask is the mathematical inverse (0.0.0.255), predominantly used in Cisco Access Control Lists (ACLs) and OSPF routing configurations to match ranges of packets.

Does this calculator transmit my IP address to any server?

No. All calculations are executed 100% locally in your web browser using client-side JavaScript. TechHub never logs, transmits, or records your private IP addresses or network topology.

What are Private IPv4 Address Ranges (RFC 1918)?

The Internet Assigned Numbers Authority (IANA) reserved three blocks of IPv4 space for private local networks:

  • 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
  • 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
  • 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)