Type an IPv4 address into the first field and a CIDR prefix length (0-32) into the second. The network address, broadcast address, subnet mask, wildcard mask, usable host range and total/usable host counts below update on every keystroke - nothing is uploaded and no calculation waits on a server round-trip.
Subnet Calculator (IPv4 CIDR)
Enter an IPv4 address and a CIDR prefix length to get the network address, broadcast address, subnet mask, wildcard mask and usable host range instantly. The math runs in your browser - no upload, no account, and nothing you type leaves the page.
What it calculates
- Network address, broadcast address, subnet mask (dotted-quad plus /N), and wildcard mask.
- Usable host range - the first usable through the last usable address, as dotted-quad addresses.
- Total-address count and usable-host count for the block.
- An IPv4 address field that is validated: invalid input shows "Enter a valid IPv4 address" instead of a wrong result.
- A CIDR prefix field clamped to 0-32.
Change either the address or the prefix and every value updates as you type.
When to use it
Use this when you are planning IP address ranges, checking whether two hosts sit in the same subnet, or verifying a CIDR block before you configure a router, firewall, or cloud VPC.
How /31 and /32 are handled
Point-to-point /31 links (RFC 3021) and single-host /32 routes are handled correctly - the tool does not reserve a network or broadcast address for those two prefix lengths, matching how real routers treat them.
Your data stays in the browser
Every value is computed by pure client-side JavaScript using 32-bit unsigned integer arithmetic - no library, no network request, and no eval. Nothing you type is sent anywhere.
Related tool
Need everyday percentage math instead? Its sibling tool, the percentage calculator, covers discounts, tax add-ons, grades and percent change.
What loads by default, and what an out-of-range prefix does
Subnet Calculator does not start blank - it loads with 192.168.1.0 and prefix /24 already filled in, so the network address, broadcast address, mask, wildcard mask and usable range are all computed and visible before you type a single character. Typing a prefix outside 0-32, for example 40, does not produce an error message. Instead the prefix is silently clamped to the nearest valid boundary (32 in that example) and every output recalculates for that boundary value. That is different from the IPv4 address field, which shows an inline "Enter a valid IPv4 address" message for bad input rather than guessing a nearby address. If the prefix field is left empty or you type letters instead of digits, the calculator falls back to the default prefix of 24 rather than showing an error.
Why a fractional prefix can make the mask and the counts disagree
The prefix field is meant for whole numbers 0-32, and typing a plain integer such as 24 or 30 always produces fully consistent numbers. But if you type or paste a decimal value like 24.5, Subnet Calculator rounds it to the nearest whole prefix (25 in this example) when it builds the subnet mask, network address and broadcast address - while the total-address and usable-host counts are worked out from the exact value you typed, without that rounding step. The result is a mask that reads "/25" next to a total-address count that does not match a real /25 block. This only happens with a non-integer prefix; if your numbers ever look inconsistent, check the prefix field for a stray decimal point.
Frequently Asked Questions
What does the subnet calculator do?
It computes the network address, broadcast address, subnet mask, wildcard mask and usable host range for an IPv4 address and CIDR prefix length (0-32), entirely in your browser.
When should I use a subnet calculator?
Use it when you are planning IP address ranges, checking whether two addresses fall in the same subnet, or verifying a CIDR block before configuring a router, firewall, or cloud VPC.
How are /31 and /32 prefixes handled?
Point-to-point /31 links (RFC 3021) and single-host /32 routes do not reserve a separate network or broadcast address, so every address in the range shows as usable - matching how real routers treat them.
Does the subnet calculator page start out blank?
No. It loads with 192.168.1.0 and prefix /24 already filled in, so you see a fully computed example (network, broadcast, mask, wildcard and usable range) before you type anything.
What happens if I type a prefix greater than 32?
It is silently clamped to 32, the largest valid IPv4 prefix, and every output recalculates for that value. No error message appears - that is different from an invalid IPv4 address, which does show one.
What happens if the prefix field is left empty or contains letters?
The calculator falls back to the default prefix of 24 instead of showing an error.
Can I type a decimal prefix like 24.5?
You can, but the mask, network and broadcast address round to the nearest whole prefix while the total-address and usable-host counts are calculated from the exact decimal you typed - so the two can briefly disagree. Use a whole-number prefix to avoid this.