IP Subnet Calculator
Work out the network and broadcast addresses, host range, subnet mask and usable host count for any IPv4 address and CIDR prefix. Calculates in your browser.
Usable hosts
-
Show the math
The prefix splits the 32-bit address into a network part and a host part. The mask is the prefix number of 1-bits; AND it with the address for the network, OR the wildcard for the broadcast:
hosts = 2^(32 − prefix) − 2
The network and broadcast addresses are reserved, so a block of N addresses holds N − 2 usable hosts. A /31 carries two point-to-point addresses (RFC 3021) and a /32 is a single host. Calculated entirely in your browser.
What this does
An IP subnet calculator finds the network and broadcast addresses, host range, subnet mask and usable host count for any IPv4 address and CIDR prefix.
How to use it
- Enter an IPv4 address.
- Enter the CIDR prefix.
- Read the network, broadcast and host range.
- Note the usable host count.
How it works
CIDR writes the prefix length after a slash, like /24 (255.255.255.0). A /32 is one host; a /31 has two usable endpoints under RFC 3021.
usable hosts = 2^(32 - prefix) - 2
Understanding your result
The usable host count is two fewer than the total, because the network and broadcast addresses are reserved, which is the detail that trips people up when a /24 gives 254, not 256, usable hosts. Use the range to plan address assignments without overlap, and note the special cases: a /31 gives two usable endpoints for point-to-point links and a /32 is a single host.
Example
A /24 has 256 addresses and 254 usable hosts.
Sources & methodology
Last updated .
Frequently asked questions
How many hosts are in a subnet?
A prefix of /n leaves 32 − n bits for hosts, so the block holds 2^(32 − n) addresses. The network and broadcast addresses are reserved, giving 2^(32 − n) − 2 usable hosts, for example a /24 has 256 addresses and 254 usable hosts.
What is CIDR notation?
CIDR writes the address with a slash and the prefix length, like 192.168.1.0/24. The prefix is the number of leading 1-bits in the subnet mask, so /24 is 255.255.255.0.
What are /31 and /32 used for?
A /32 identifies a single host. A /31 has just two addresses and, under RFC 3021, both are usable as the endpoints of a point-to-point link, so no addresses are wasted on network and broadcast.
Related tools
User Agent Parser
Decode a browser user-agent string into its browser, version, rendering engine, operating system and device type. Parses in your browser.
MAC Address Lookup
Look up the manufacturer behind any MAC address, split it into its OUI and device parts, and see whether it is unicast/multicast and universal/locally administered. Matched against the bundled IEEE registry in your browser.
Password Entropy Calculator
Measure a password’s entropy in bits from its length and character variety, with a strength rating and a rough offline crack-time estimate. Runs in your browser.
Uptime & SLA Calculator
Turn an availability target like 99.9% into the downtime it allows per day, week, month, quarter and year. See exactly what each “nine” costs. Calculates in your browser.