🌐 IPv4 Subnet Calculator

Calculate CIDR ranges, masks, and host details instantly in your browser.

Last updated: November 8, 2026 · By the BoltQuickTools team

Prefix Length /24
Enter an IPv4 address and prefix to calculate subnet details.
Tip: You can use this for VPC planning, firewall rules, ACL debugging, DHCP scopes, and route validation.

Working out the boundaries of an IPv4 subnet

Before writing a firewall rule, sizing a DHCP scope or carving up a VPC, you need the exact first and last address of a range. Doing that binary by hand is where off-by-one mistakes come from, so this page calculates it for one address and prefix at a time.

Entering an address and prefix

  1. Type a plain address in IPv4 Address, for example 10.20.30.40.
  2. Drag Prefix Length to the size you want, from /0 to /32. The arrow keys move it one step when the slider has focus.
  3. Results appear about 300 ms after any change, or straight away with Calculate. Load Sample fills in 192.168.10.24/24 and Clear resets the form.

The address does not have to be the network address. Enter any host and the page snaps to the block that contains it.

Example: 10.20.30.40 with /26

RowValue
Subnet Mask255.255.255.192
Wildcard Mask0.0.0.63
Network Address10.20.30.0
Broadcast Address10.20.30.63
First Host10.20.30.1
Last Host10.20.30.62
Total Addresses64
Usable Hosts62
ClassA
Address TypePrivate (RFC1918)
Mask Binary11111111.11111111.11111111.11000000

A /31 and /32 are treated specially. 203.0.113.8/31 gives First Host 203.0.113.8, Last Host 203.0.113.9 and Usable Hosts 2, the point-to-point style of use. 8.8.8.8/32 gives Usable Hosts 1.

Input and output quirks

Reading the results

Why does a /31 list a broadcast address?

The row always shows the top address of the block. On a /31 that is 203.0.113.9 in the example above, which is a normal usable endpoint rather than a real broadcast.

Can I use the wildcard mask in an ACL?

Yes, that is the format Cisco-style access lists expect. For the example above you would write network 10.20.30.0 with wildcard 0.0.0.63.

How do I check whether two addresses share a subnet?

Enter each one with the same prefix and compare the Network Address row. If they match, the addresses are in the same block.

For the reasoning behind these numbers, read subnet math explained. The Number Base Converter helps if you want to check the binary yourself, and the IPv6 Subnet Calculator covers 128-bit addresses.