IPv4 subnet calculator

Netmask, CIDR, wildcard mask, and usable range

All computation runs locally in your browser

Last updated: February 8, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Netmask
Network address
Network mask
Network mask in binary
CIDR notation
Wildcard mask
Network size
First address
Last address
Broadcast address
IP class

Introduction / overview

The IPv4 Subnet Calculator takes an IPv4 address like 192.168.24.0/24 and outputs the network block details: netmask, wildcard mask, network size, first/last usable host, and broadcast address.

What problems it solves

Quickly answer: “What’s the usable range?”, “What’s the broadcast?”, “Is this a /27 or /28?”, and “How many addresses do I get?”

Who it’s for

Network engineers, IT admins, students, and developers configuring VPNs, firewalls, routers, cloud subnets, or lab environments.

Why the results are reliable

The calculator uses the same address parsing and subnet math found in the original it-tools tool. Everything runs locally in your browser, so your inputs are not sent to a server.

If you’re also working with URLs, tokens, or headers, pairing this with our URL parser or Basic auth generator can speed up day-to-day troubleshooting.

How to use (quick start)

  1. Enter an IPv4 address with a mask, for example 192.168.24.0/24.
  2. If you prefer, you can use a dotted mask: 192.168.24.0/255.255.255.0.
  3. Read the outputs: Network address, First address, Last address, and Broadcast.
  4. Use Previous block / Next block to step through adjacent subnets with the same mask.

Worked example (with steps)

Suppose you have 192.168.24.0/24. A /24/24 means 24 network bits and 3224=832-24=8 host bits.

Network size\text{Network size}==2(3224)2^{(32-24)}==282^8==256256

That means the block contains 256 total addresses. In a typical /24/24 subnet, the network address is 192.168.24.0 and the broadcast is 192.168.24.255. The calculator also shows the commonly used “usable host” range: 192.168.24.1 to 192.168.24.254.

How to interpret the results

  • Network mask

    The dotted-quad mask (for example 255.255.255.0) derived from the CIDR prefix length.

  • Wildcard mask

    The inverse of the network mask, often used in ACL rules.

  • First / last address

    The range of addresses typically used for hosts (note: some environments treat these differently).

Real-world examples / use cases

Router/VPN subnet planning

Background: You need a small subnet for a site-to-site VPN.

Input: 10.20.30.0/27.

Result: Network size is 23227=322^{32-27}=32 addresses; the calculator shows the usable range and broadcast.

Application: Use the first few IPs for the VPN gateway, monitoring, and reserved infrastructure.

Lab environment IP ranges

Background: You want a predictable private range for VMs.

Input: 192.168.56.0/24.

Result: 23224=2562^{32-24}=256 total addresses; common usable range is 192.168.56.1 to 192.168.56.254.

Application: Reserve low addresses for services, keep the rest for VMs.

Firewall ACL wildcard masks

Background: You need an ACL rule that matches a subnet.

Input: 172.16.8.0/21.

Result: The calculator provides the wildcard mask, which many ACL syntaxes require.

Application: Copy the wildcard mask directly into your rule, then share the link with teammates for review.

Troubleshooting “wrong network” issues

Background: A device is configured as 192.168.1.130/25 and can’t reach a host you expected.

Input: 192.168.1.130/25.

Result: The network block starts at 192.168.1.128, not 192.168.1.0.

Application: Fix the mask or move the IP into the subnet where the gateway lives.

Related tool

If your troubleshooting starts from a URL (for example, a service endpoint), parse it first with our URL parser to extract the hostname/port cleanly.

Common scenarios (when to use)

Splitting a /24 into smaller blocks

Walk through /25, /26, /27 blocks using Next/Previous block to see boundaries.

Writing ACL rules

Use wildcard masks and network ranges to match exactly the traffic you intend.

Allocating IPs to services

Pick a subnet size that comfortably fits hosts, plus headroom.

Sanity-checking CIDR math

Confirm a prefix length corresponds to the range you think it does.

Verifying network vs host bits

Understand why /30 behaves differently (point-to-point) compared to /24.

Debugging “can’t reach gateway”

Check whether an IP actually falls inside the gateway’s subnet.

When it may not apply

Some platforms treat the first/last addresses differently (for example, special reserved addresses in certain cloud providers). Use the calculator as a baseline, then confirm your platform’s rules.

Tips & best practices

  • Prefer CIDR notation (like /24) when documenting networks; it’s unambiguous and compact.

  • Use Next/Previous block to find the exact boundary where your subnet starts and ends.

  • If you’re writing ACLs, copy the wildcard mask directly to avoid off-by-one errors.

  • When you need N hosts, plan for growth: pick a subnet that provides headroom.

  • Share the calculator link with results enabled to align on the same subnet during reviews.

Calculation method / formulas

Let the prefix length be nn (for example, n=24n=24). IPv4 has 3232 bits total.

Network size=2(32n)\text{Network size} = 2^{(32-n)}

The network address is the bitwise AND of the IP and the mask:

Network=IP & Mask\text{Network} = \text{IP} \ \&\ \text{Mask}

The broadcast address (when applicable) is:

Broadcast=Network+2(32n)1\text{Broadcast} = \text{Network} + 2^{(32-n)} - 1

The wildcard mask is the bitwise NOT of the network mask:

Wildcard=¬Mask\text{Wildcard} = \lnot \text{Mask}

For typical subnets with n30n \le 30, the “usable host” range is often reported as:

First host=Network+1\text{First host} = \text{Network} + 1
Last host=Broadcast1\text{Last host} = \text{Broadcast} - 1

Variable meanings

  • nnCIDR prefix length (number of network bits).
  • 2(32n)2^{(32-n)}Total number of addresses in the block.

Related concepts / background

CIDR is a way to express the mask as a prefix length (like /24/24). A smaller prefix length means a larger subnet.

IP classes (A/B/C/D/E) are a historical concept tied to the first octet. Modern networks mainly use CIDR, but class can still be useful as quick context.

FAQs

Can I enter an IP without a mask?

Yes. If you omit the mask, the calculator assumes /32/32.

Why is there sometimes “no broadcast address”?

For very small masks (for example /31/31 or /32/32), the notion of broadcast/usable hosts may not apply the same way as larger subnets.

What does wildcard mask mean?

It’s the inverse of the network mask. If the mask is 255.255.255.0, the wildcard is 0.0.0.255.

Is the “first/last address” always usable?

Often yes for traditional subnets, but rules can differ by platform. Treat it as a helpful default and confirm any reserved-address policies.

How can I share exactly what I’m seeing?

Use the Share button and enable “share calculator with results”. It generates a link with your input encoded.

Limitations / disclaimers

This calculator focuses on IPv4 subnet math. It doesn’t model vendor-specific behaviors, routing policies, or platform-reserved addresses. Always validate changes in a safe environment before applying them to production.

External references / sources

IPv4 subnet calculator | CalculatorVast