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.
Privacy First: 100% Client-Side Processing
Processed in your browser. Files are never uploaded.
How to Use the Subnet Calculator (IPv4 CIDR & Network Mask)
- 1Enter an IPv4 address (e.g., 192.168.1.100 or 10.0.0.1).
- 2Select your CIDR prefix mask from /0 to /32 (e.g., /24 for 255.255.255.0).
- 3Review the network address, broadcast address, and first/last usable host addresses.
- 4Inspect the 32-bit binary representation and usable host count.
Formula & How It Works
Bitwise IPv4 Subnetting Logic
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.
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.
Single Host Route (/32)
Input: IP = 172.16.5.4, Mask = /32
Explanation: Represents an individual endpoint or loopback interface.
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 Prefix | Subnet Mask | Wildcard Mask | Usable Host Count | Class Equivalent |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 0.0.0.0 | 1 host | Single host route |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 hosts | Legacy point-to-point |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 hosts | Small server pod |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 hosts | Class C standard |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 hosts | Class B standard |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 hosts | Class 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.
Related Online Tools
Explore complementary calculators and converters with instant client-side execution
Regex Tester & Debugger (JavaScript RegEx)
Test and debug regular expressions in real time with match count, captured group inspection, and string replacement.
XML Formatter & Beautifier (Syntax Validator)
Format, beautify, and minify XML code with 2-space or 4-space indentation and tag validation.
Binary to Decimal Converter (Base-2 to Base-10 Solver)
Convert binary numbers to decimal with step-by-step place-value expansions and conversions to hex and octal.
Case Converter – UPPER, lower, camelCase, Title
Transform text casing into UPPER, lower, Title Case, Sentence case, camelCase, snake_case, and kebab-case instantly.
Sentence Counter – Words, Sentences & Readability
Count sentences, words, paragraphs, and characters with reading time and readability metrics.
Tiny Text Generator – Small Caps, Subscript, Bubbles
Generate stylish tiny Unicode text including small caps, superscript, subscript, and bubble letters for social media.
Explore Other Tool Categories
Browse our full collection of 50 free web utilities
Unit Converters
Exact metric & imperial conversions for weight, length, temperature & volume.
Math & Education
Percentage changes, fractions, square roots, geometry & statistics.
Date & Time
Calendar arithmetic, business day intervals, stopwatch & multi-counter.
Home & Construction
Paint coverage, pool volume, topsoil, roof pitch, square footage & materials.