Subnet Calculator

Updated July 2026

Enter an IPv4 address and a CIDR prefix to instantly see the network address, broadcast address, subnet mask, wildcard mask, usable host range and number of hosts — plus the IP class and whether the address is private. Everything runs privately in your browser.

Enter an IPv4 address and a CIDR prefix (like 192.168.1.0/24) to get the network address, broadcast address, subnet mask, usable host range and number of hosts. A /24 has 256 addresses and 254 usable hosts.
You can also type an address with the prefix, e.g. 192.168.1.10/24.
The number of network bits. /24 = mask 255.255.255.0.
Network
Network address
Broadcast address
Subnet mask
Wildcard mask
First usable host
Last usable host
Total addresses
Usable hosts
IP class / type

How this subnet calculator works

Every IPv4 address is really a 32-bit number split into four 8-bit octets, such as 192.168.1.10. A subnet groups a range of those addresses together. The CIDR prefix — the number after the slash — says how many leading bits belong to the network; the rest belong to the hosts inside that network.

The calculator converts your IP to a single 32-bit unsigned integer and builds a subnet mask from the prefix (the first n bits set to 1). It then does the bitwise math: the network address is the IP AND the mask (all host bits cleared), and the broadcast address is the network OR the wildcard mask (all host bits set). The first and last usable hosts sit just inside those two boundaries.

Worked example: for 192.168.1.10/24, the mask is 255.255.255.0 and the wildcard is 0.0.0.255. The network address is 192.168.1.0 and the broadcast is 192.168.1.255. That leaves 192.168.1.1 to 192.168.1.254 as usable hosts — 256 total addresses, 254 usable. The address falls in 192.168.0.0/16, so it is a private (RFC 1918) address.

Special cases: a /31 has just 2 addresses and, per RFC 3021, both are usable on point-to-point links — so this tool reports 2 usable. A /32 is a single host address with 1 address and 0 usable hosts in the conventional sense.

Common CIDR prefixes

CIDRSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614

Frequently asked questions

What is a subnet mask?
A subnet mask is a 32-bit value that splits an IPv4 address into a network part and a host part. Bits set to 1 mark the network; bits set to 0 mark the hosts. A mask of 255.255.255.0 has 24 network bits — the same as a /24 prefix.
What does /24 mean (CIDR)?
In CIDR notation the number after the slash is the prefix length: the count of leading bits used for the network. /24 means the first 24 bits are the network, leaving 8 bits for hosts — 256 total addresses and 254 usable hosts.
How many hosts are in a /24 or /16?
A /24 has 256 addresses and 254 usable hosts. A /16 has 65,536 addresses and 65,534 usable hosts. In general, usable hosts = 2^(32 − prefix) − 2.
What is the difference between the network and broadcast address?
The network address is the first address in the block (all host bits 0) and names the subnet. The broadcast address is the last address (all host bits 1) and reaches every host at once. Neither is assigned to a host, so both are excluded from the usable range.
What are the private IP ranges?
RFC 1918 reserves three private ranges not routed on the public internet: 10.0.0.0/8 (10.x), 172.16.0.0/12 (172.16.x to 172.31.x) and 192.168.0.0/16 (192.168.x). They are used for internal networks behind NAT.
How do I calculate a subnet?
Convert the IP to a 32-bit number, build the mask from the prefix, then AND the IP with the mask for the network address. The broadcast is the network OR the wildcard (inverted mask). Usable hosts = 2^(32 − prefix) − 2.
⚡ Subnet Calculator — by larely ↗

Related tools

PX to REM Converter

Convert between px, rem, em and pt for CSS at any base font size.

Hash Generator

Generate SHA-256, SHA-1, SHA-384 and SHA-512 hashes in your browser.

JWT Decoder

Decode a JSON Web Token's header and payload .

Sort Text Lines

Sort, deduplicate, reverse, shuffle and clean a list of lines.

JSON to CSV Converter

Convert a JSON array to CSV and CSV back to JSON.

URL Encoder / Decoder

Percent-encode and decode text, and parse a URL into its parts.

Word Frequency Counter

Find the most-used words and keyword density in any text.

Image to Base64 Converter

Encode an image to a Base64 data URI for HTML or CSS, in your browser.

What Is My Browser?

Detect your browser, OS, screen resolution, window size and more.

Chmod Calculator

Convert file permissions between octal , symbolic and the chmod command.

Password Strength Checker

Estimate password entropy and crack time, entirely in your browser.

UTM Link Builder

Build campaign tracking URLs with UTM parameters for Google Analytics.

Browse all 251 free tools →