IPv4 Subnet Calculator

Enter an IPv4 address and a subnet mask (CIDR notation) to get the full picture: network address, broadcast address, usable host range, mask, wildcard, and binary breakdown. Everything runs in your browser.

IPv4 Subnet Calculator

Need a specific number of hosts?

Enter how many usable hosts you need and get the smallest subnet mask that fits.

How to use the subnet calculator

Type any IPv4 address and drag the CIDR slider (or tap one of the quick-mask chips) to see every subnet detail update live. The calculator returns the network address, broadcast address, dotted-decimal subnet mask, wildcard mask, the usable host range, and the address count — plus a binary view so you can see exactly which bits belong to the network and which to the hosts.

What is subnetting?

Subnetting is the practice of dividing a larger IP network into smaller logical networks. An IPv4 address is 32 bits: a subnet mask (written in CIDR notation, like /24) says how many of those leading bits identify the network. The remaining bits identify individual hosts inside that network.

For example, 192.168.1.130/26 has 26 network bits and 6 host bits. That gives 64 total addresses, of which 62 are usable for hosts — one is reserved as the network address (the first) and one as the broadcast address (the last).

The formulas, if you want them

  • Subnet mask: set the first N bits to 1, the rest to 0, where N is the CIDR number.
  • Network address: IP AND subnet mask (all host bits become 0).
  • Broadcast address: network address OR wildcard mask (all host bits become 1).
  • Total addresses: 2 to the power of (32 − CIDR).
  • Usable hosts: total − 2 (network and broadcast are reserved), except for /31 point-to-point links and /32 single-host routes.
  • A worked example: splitting a /24 into four /26s

    Say you have 192.168.10.0/24 and you want to separate servers, printers, Wi-Fi clients, and guest devices so a compromise in one group can’t touch the others. Each /26 gives you 64 addresses with 62 usable hosts — more than enough per group. The four blocks fall on fixed boundaries: 192.168.10.0/26 (usable .1 through .62), 192.168.10.64/26 (.65 through .126), 192.168.10.128/26 (.129 through .190), and 192.168.10.192/26 (.193 through .254). Type any of those into the calculator and you can verify every boundary. Notice what you did NOT get to choose: a /26 must land on a multiple of 64. That alignment rule is the one thing most people get wrong when planning by hand — and the reason the calculator shows the network address instead of just trusting your input.

    Common subnetting mistakes (and the ten-second checks)

  • Misaligned blocks: 192.168.1.37/26 is not a network — it silently becomes 192.168.1.0/26. If a firewall rule “doesn’t match” one address, check alignment first: paste the range into the IP Range Expander and see the block it actually lands in.
  • Counting the network and broadcast as hosts: a /29 has 8 addresses but only 6 usable. Sizing a DHCP pool at “8 devices per /29” fills up and then some.
  • Forgetting the router’s address: every subnet burns one usable address on its gateway. A /30 gives you 2 usable — one for each end of a point-to-point link, which is exactly why it exists.
  • Sizing by today instead of by growth: a /28 (14 hosts) that’s 80% full on day one is a renumbering project waiting to happen. One prefix bigger costs nothing at planning time.

    Subnet calculator FAQ

    How many usable hosts are in a /26, /27, or /28? 62, 30, and 14 — the pattern is always 2 to the host bits minus 2 (or minus nothing on /31 and /32 links). The calculator’s host-count tile shows it for any mask.

    What’s the difference between /24 and 255.255.255.0? None — they’re the same mask written two ways. CIDR notation counts the one-bits; dotted decimal spells them out. The binary view in the calculator shows both describing the same thing.

    What’s the biggest and smallest subnet I can make? /0 is the entire IPv4 internet (one block, no boundaries); /32 is a single address, used for host routes and loopbacks. Everything real lives between those.

    Does this work for public IPs or just private ranges? Both — the math is identical. Only the RFC 1918 ranges (10/8, 172.16/12, 192.168/16) are reserved for private use; the calculator doesn’t care which you enter.

    Like every tool on this site, the subnet calculator runs entirely in your browser. Your input is never sent anywhere or stored anywhere.