Free 100% In-Browser Tool

Subnet Calculator: IPv4 Network & Host Range

Calculate IPv4 subnets, CIDR masks (/0 to /32), network/broadcast IDs, and usable IP host ranges with binary breakdowns.

Quick Answer:A subnet mask splits an IPv4 address into a network prefix and a host identifier using bitwise AND operations (e.g., 192.168.1.0/24 provides 254 usable host IPs).
Initializing tool...

Privacy First: 100% Client-Side Processing

Processed in your browser. Files are never uploaded.

How to Use the Subnet Calculator (IPv4 CIDR & Network Mask)

  1. 1Enter an IPv4 address (e.g., 192.168.1.100 or 10.0.0.1).
  2. 2Select your CIDR prefix mask from /0 to /32 (e.g., /24 for 255.255.255.0).
  3. 3Review the network address, broadcast address, and first/last usable host addresses.
  4. 4Inspect the 32-bit binary representation and usable host count.

Formula & How It Works

Bitwise IPv4 Subnetting Logic

Net = IP & Mask | Brd = Net | ~Mask | Hosts = 2^(32 - CIDR) - 2

Network ID = IP AND Subnet Mask. Broadcast Address = Network ID OR Wildcard Mask. Usable Hosts = 2^(32 - CIDR) - 2.

Worked Examples

Standard Home / Office Subnet (/24)

Input: IP = 192.168.1.100, Mask = /24

Explanation: A /24 subnet has 256 total addresses; subtracting network and broadcast yields 254 usable hosts.

Result: Net: 192.168.1.0 | Usable: 192.168.1.1 – 192.168.1.254 (254 hosts) | Broadcast: 192.168.1.255

RFC 3021 Point-to-Point Link (/31)

Input: IP = 10.0.0.0, Mask = /31

Explanation: Under RFC 3021, /31 links between two routers use both addresses as hosts with zero wasted IPs.

Result: Usable: 10.0.0.0 – 10.0.0.1 (2 usable hosts) | RFC 3021 Compliant

Single Host Route (/32)

Input: IP = 172.16.5.4, Mask = /32

Explanation: Represents an individual endpoint or loopback interface.

Result: Host: 172.16.5.4 (1 usable host, Mask 255.255.255.255)

Frequently Asked Questions

What does the /24 in an IP address mean?▼

The /24 is CIDR notation indicating that the first 24 bits of the 32-bit address are the network prefix (255.255.255.0), leaving 8 bits for 254 usable host devices.

Why do you subtract 2 from total host addresses?▼

In standard subnets, the very first address is reserved as the Network ID, and the very last address is reserved as the Broadcast Address.

What is an RFC 3021 /31 subnet?▼

RFC 3021 allows two routers on a dedicated point-to-point link to use a /31 subnet without reserving separate network or broadcast addresses, saving valuable IPv4 space.

What is a wildcard mask?▼

A wildcard mask is the bitwise inverse of a subnet mask (255.255.255.255 minus the subnet mask), commonly used in Cisco access control lists (ACLs) and OSPF routing.

Is this calculation private?▼

Yes, all network calculations execute client-side in your web browser with zero telemetry.

Quick Reference & Conversion Table

CIDR PrefixSubnet MaskWildcard MaskUsable Host CountClass Equivalent
/32255.255.255.2550.0.0.01 hostSingle host route
/30255.255.255.2520.0.0.32 hostsLegacy point-to-point
/28255.255.255.2400.0.0.1514 hostsSmall server pod
/24255.255.255.00.0.0.255254 hostsClass C standard
/16255.255.0.00.0.255.25565,534 hostsClass B standard
/8255.0.0.00.255.255.25516,777,214 hostsClass A standard

⚠️ Common Pitfalls to Avoid

  • •Confusing total addresses (2^(32-CIDR)) with usable host addresses (total minus network and broadcast).
  • •Using octet values outside the 0–255 range.
  • •Crashing on /31 subnets (our tool properly adheres to RFC 3021 for modern router point-to-point links).

💡 Practical Real-World Uses

  • •Configuring AWS VPC subnets, Azure Virtual Networks, and Google Cloud VPCs.
  • •Designing corporate LANs, VLAN segmentation, and firewall routing rules.
  • •Studying for Cisco CCNA, CCNP, CompTIA Network+, and Linux administrator certifications.

Classful vs Classless (CIDR) Subnetting

  • ✓Classful routing (Classes A, B, C) strictly allocated fixed masks (/8, /16, /24), leading to massive waste of IPv4 addresses.
  • ✓CIDR (Classless Inter-Domain Routing) introduced in 1993 allows arbitrary subnet masks (/0 through /32) for efficient IP allocation.
Last reviewed & updated: 2026-11-01
Free & Open Access
Related Utilities

Explore complementary calculators and converters with instant client-side execution

More in Text & Dev

Explore Other Tool Categories

Browse our full collection of 50 free web utilities

View All 8 Categories