Subnet calculator
Enter an IPv4 address and CIDR prefix length (or standard subnet mask) to calculate network boundaries, broadcast addresses, usable host ranges, and wildcard masks. Includes bit breakdown and quick prefix reference. All math runs entirely in this browser tab without network requests.
Runs locally in your browser · No network requests
Supports standard IPv4 or CIDR format like 10.0.0.1/24
/24 (255.255.255.0)
Calculation Results
Network Address
192.168.1.0
/24
Subnet Mask
255.255.255.0
Wildcard: 0.0.0.255
Usable Hosts
254
Total: 256
Broadcast Address
192.168.1.255
Scope: Private
Network & Addressing Specification
- Usable Host Range
- 192.168.1.1 – 192.168.1.254
- First Usable Host
- 192.168.1.1
- Last Usable Host
- 192.168.1.254
- CIDR Notation
- 192.168.1.0/24
- IP Classification
- Class C · Private (RFC 1918)
- Hex Representation
- IP: 0xc0a80132 · Mask: 0xffffff00
Binary Bit Breakdown
Subnet mask has 24 network bits and 8 host bits.
Common IPv4 CIDR Reference Table
| CIDR | Subnet Mask | Usable Hosts | Common Usage | Action |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | Class A (/8) | |
| /16 | 255.255.0.0 | 65,534 | Class B (/16) | |
| /20 | 255.255.240.0 | 4,094 | Large Office (/20) | |
| /22 | 255.255.252.0 | 1,022 | Medium Office (/22) | |
| /24 | 255.255.255.0 | 254 | Class C / Standard LAN (/24) | |
| /25 | 255.255.255.128 | 126 | Half Subnet (/25) | |
| /26 | 255.255.255.192 | 62 | Quarter Subnet (/26) | |
| /27 | 255.255.255.224 | 30 | 32-IP Block (/27) | |
| /28 | 255.255.255.240 | 14 | 16-IP Block (/28) | |
| /29 | 255.255.255.248 | 6 | Small Subnet (/29) | |
| /30 | 255.255.255.252 | 2 | Legacy Point-to-Point (/30) | |
| /31 | 255.255.255.254 | 2 | Modern Point-to-Point (/31) | |
| /32 | 255.255.255.255 | 1 | Host Route (/32) |
Example
Standard Class C LAN (/24)
192.168.1.50/24 produces network address 192.168.1.0, netmask 255.255.255.0, broadcast 192.168.1.255, usable host range 192.168.1.1 through 192.168.1.254, and 254 usable hosts.
Related: JWT decoder, Hash generator, Timestamp converter, CIDR calculator
FAQ
- Does this subnet calculator send my IP addresses to a server?
- No. All IP parsing and subnet bitwise arithmetic execute locally in JavaScript inside your browser. No IP addresses, subnets, or network topologies are ever transmitted or logged.
- What is CIDR notation?
- Classless Inter-Domain Routing (CIDR) notation expresses an IP address and its associated routing prefix length using a forward slash followed by the count of leading 1 bits in the subnet mask (e.g. /24 equals 255.255.255.0).
- How are usable host addresses determined?
- For standard subnets (/0 to /30), the first address is the Network Address and the last address is the Broadcast Address, leaving 2^(32 - prefix) - 2 usable host addresses. For point-to-point links (/31 under RFC 3021), both addresses are usable hosts. For /32 host routes, 1 host is addressable.
- What is a wildcard mask?
- A wildcard mask is the bitwise inverse of a subnet mask (255.255.255.255 - subnet mask). It is commonly used in Cisco IOS Access Control Lists (ACLs) and Open Shortest Path First (OSPF) network configurations.
- How do I calculate an IPv4 subnet without this page?
- Convert the 4 octets to a 32-bit integer: ipInt = (o1 << 24) | (o2 << 16) | (o3 << 8) | o4. For prefix n (0..32), maskInt = n === 0 ? 0 : (0xffffffff << (32 - n)) >>> 0. Wildcard mask = (~maskInt) >>> 0. Network address = (ipInt & maskInt) >>> 0. Broadcast address = (networkInt | wildcardInt) >>> 0. Total hosts = 2^(32 - n). Usable hosts = n === 32 ? 1 : n === 31 ? 2 : Math.max(0, totalHosts - 2). First usable = networkInt + 1; last usable = broadcastInt - 1. Format each 32-bit int as octets: (int >>> 24) & 255, (int >>> 16) & 255, (int >>> 8) & 255, int & 255.