IPv4 Subnet Calculator
Calculate IPv4 CIDR network address, directed broadcast address, dotted-decimal and hexadecimal subnet mask, ACL wildcard mask, total address count, and usable host range for any prefix from /0 to /32.
CIDR classless prefix /24 (24 network bits, 8 host bits) · Private-Use Network (Home & Small Office LAN)
192.168.1.0/24
192.168.1.0
192.168.1.255
192.168.1.1 – 192.168.1.254
How Classless Inter-Domain Routing (CIDR) Subnetting Works
Classless Inter-Domain Routing (CIDR, RFC 4632) replaced rigid Class A, B, and C boundaries with a variable-length prefix suffix written as /N (where N is the number of leading 1 bits in the 32-bit subnet mask). The remaining 32 − N trailing bits identify individual host interfaces inside that subnet:
- Network Address: Computed via bitwise AND between the IPv4 address and the subnet mask (all host bits set to 0).
- Broadcast Address: Computed by setting all 32 − N host bits to 1.
- Usable Host Range: For prefixes /0 through /30, usable hosts equal 2^(32−N) − 2 because the network and directed broadcast addresses are reserved.
Special Prefixes: /31 and /32
Conventional formulas yield zero usable hosts for /31 and /32, which is why our calculator handles them explicitly:
- RFC 3021 (/31 Point-to-Point Links): Used between two router interfaces where broadcast isn't needed; both addresses in the 2-address block are usable.
- Host Route (/32): Refers to a single specific IPv4 loopback or host interface (1 usable address). Need to convert an arbitrary IP range into CIDRs? Use our IP Range to CIDR Calculator.
Technical Specifications & Protocol Facts
Authoritative parameters, dimensions, and IETF RFC compliance
| Parameter / Dimension | Technical Specification | Standard / Authority |
|---|---|---|
| Supported CIDR Prefix Range | /0 (0.0.0.0) through /32 (255.255.255.255) | RFC 4632 CIDR |
| Point-to-Point Link Support | /31 subnet provides 2 usable hosts with no broadcast overhead | RFC 3021 |
| Host Route Handling | /32 single-host route provides 1 usable address | RFC 4632 |
| Computation Engine | 100% deterministic 32-bit BigInt bitwise math (zero external API delay) | IEEE / IETF Bitwise |
Frequently Asked Questions
Concise answers verified against IANA, APNIC, and IETF protocol standards
How is the number of usable hosts calculated for a standard IPv4 subnet?
For prefixes from /0 to /30, total addresses equal 2^(32 - prefix), and usable hosts equal 2^(32 - prefix) - 2 because the first address is reserved as the network identifier and the last as the directed broadcast address.
Why does a /31 CIDR subnet have 2 usable hosts instead of 0?
RFC 3021 defines /31 prefixes specifically for point-to-point router links where broadcast is unnecessary, allowing both addresses in the 2-address block to be assigned to interfaces.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask uses 1-bits to mark the network prefix (e.g., 255.255.255.0 for /24), whereas a wildcard mask is the bitwise inverse (0.0.0.255) used in router ACLs and OSPF configurations.
Related Network Tools & Technical Guides
Contextual utilities and reference documentation verified for this workflow
Diagnostic & Calculation Utilities
- IP Range to CIDR Calculator
Convert any arbitrary IPv4 start–end boundary into minimal covering CIDR blocks for firewall rules and routing.
- IP Address Validator & Classifier
Verify syntactic validity and inspect whether an IP is globally routable or reserved in an IANA special-purpose block.
- IP Address Converter
Convert IPv4 and IPv6 addresses across canonical, expanded, decimal integer, hexadecimal, binary, and reverse ARPA forms.
Subnet Calculator · Canonical: https://ipaddresslookup.in/subnet-calculator · Reviewed: 2026-11-01
Reviewer: IPAddressLookup.in Technical Network Utility Group · Stateless Privacy · Accuracy & Data Limits