Back to All Tools

IPv4 Subnet Calculator

Enter an IPv4 address and CIDR to compute network, broadcast, host range, mask, wildcard, host counts, and binary representation.

Runs entirely in your browser — nothing is uploaded
/
Class
C
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Network
192.168.1.0/24
Broadcast
192.168.1.255
First host
192.168.1.1
Last host
192.168.1.254
Total addresses
256
Usable hosts
254
IP
11000000.10101000.00000001.00101010
Mask
11111111.11111111.11111111.00000000
Network
11000000.10101000.00000001.00000000
Broadcast
11000000.10101000.00000001.11111111

About the IPv4 Subnet Calculator

This is an IPv4 subnet calculator. You give it one address and a CIDR prefix like 192.168.1.42/24, and it works out the numbers you would otherwise do by hand: the network address, the broadcast address, the usable host range, the subnet mask, the wildcard mask, and how many addresses the block holds. It answers which addresses belong to a subnet and which are free to assign.

You type the address in one field and the prefix in the number box after the slash, or drag the slider from 0 to 32. The results recompute at once. The math is bitwise: the address becomes a 32-bit integer, the mask shifts ones into the high bits, and network and broadcast come from ANDing and ORing that mask. Bad octets trigger a red 'Not a valid IPv4 address' warning.

Every subnet figure is computed in the browser, so there is no account and no address data leaves the page. Nothing you type is sent to a server; the calculation happens in local JavaScript on your machine. That means you can plan address space for internal networks without exposing them, and it keeps working the same whether you check one subnet or fifty in a row while sketching an allocation plan.

How to use the IPv4 Subnet Calculator

  1. 1Type an IPv4 address such as 10.0.5.20 into the IP field.
  2. 2Set the prefix in the number box after the slash, or drag the slider from 0 to 32.
  3. 3Watch the results panel fill in the subnet mask, wildcard mask, network, and broadcast.
  4. 4Read First host and Last host for the assignable range, and Usable hosts for the count.
  5. 5Scroll to the Binary view to see the IP, mask, network, and broadcast in dotted binary.
  6. 6Move the prefix up or down to compare how splitting the block changes the host count.

What you can use it for

Splitting an office network

You have a 10.10.0.0/16 and need separate ranges for staff, printers, and guests. Push the slider to /24 or /26 and read the Usable hosts count to confirm each slice holds enough devices before you commit.

Writing a firewall rule

A Cisco access list wants the wildcard mask, not the subnet mask. Enter the network and prefix, then read the Wildcard mask row directly instead of inverting the octets by hand and risking a mistake.

Checking a host belongs

Someone says 192.168.4.130 cannot reach the gateway. Enter it with the subnet's prefix and compare the Network and Broadcast rows to see whether it falls inside the block or was set on the wrong subnet.

Teaching how masks work

The Binary view lines up the IP, mask, network, and broadcast bit for bit. Slide the prefix and watch the boundary between ones and zeros move, showing how the mask splits the network from the host part.

How the mask carves a network

The subnet mask is 32 bits: ones for the network part, then zeros for the host. The prefix counts the ones, so /24 is 255.255.255.0. The tool ANDs the address with the mask to find the network, then ORs that with the wildcard for the broadcast.

The network address has all host bits zero and the broadcast has them all one, so neither can be assigned. That leaves the addresses between them, which is why each extra prefix bit halves the usable host count and each bit you drop doubles it.

Frequently asked questions

Does my address data get uploaded anywhere?

No. The calculator runs completely in your browser using local JavaScript. Your address and prefix are never sent to a server, so you can plan private or internal ranges without leaking them. To confirm it, load the page, go offline, and watch it still compute.

Why do /31 and /32 not subtract two hosts?

For /30 and shorter, the tool subtracts the network and broadcast addresses to give usable hosts. A /32 is a single address, and a /31 is a two-address point-to-point link per RFC 3021, so both slots stay usable and the host rows shift to match.

What is the wildcard mask for?

The wildcard mask is the bitwise inverse of the subnet mask, so a /24 mask of 255.255.255.0 becomes 0.0.0.255. Cisco access lists and some routing configs expect this inverted form, and the tool computes it so you do not flip every octet by hand.

Does it handle IPv6 addresses?

No, this tool is IPv4 only. The address field expects four dotted octets from 0 to 255, and the prefix ranges from 0 to 32. Anything with colons or a fifth group is rejected with the invalid-address warning, so IPv6 planning needs a separate calculator.

What prefix lengths can I enter?

Any value from 0 to 32. The number box and slider both clamp to that range, so typing 40 or a negative number snaps back inside the limit. A /0 spans the whole IPv4 space, and /32 pins a single address.