๐Ÿฆ IP Animals
๐Ÿงฎ Subnetting & IP Math

IPv4 Subnet Calculator

A fast, free IPv4 subnet calculator: enter an IP and CIDR or subnet mask to instantly get the network address, broadcast, usable host range, host count, wildcard mask and IP class โ€” all worked out privately in your browser.

What this IPv4 subnet calculator does

This subnet calculator takes any IPv4 address together with a prefix length (like /24) or a dotted subnet mask and works out every value network engineers reach for: the network address, the broadcast address, the range of usable host addresses, the total and usable host counts, the wildcard mask and the address class. It is perfect for planning a network, answering a Cisco or CompTIA question, or double-checking a firewall rule.

How to use it

  • Type an address with a slash, such as 10.0.0.0/8, and the prefix is read automatically.
  • Or enter just the IP and choose the mask from the dropdown (every prefix from /0 to /32, with its dotted mask shown).
  • Results update as you type and when you press Calculate. Use the copy buttons to grab any value.

The idea behind subnetting

An IPv4 address is 32 bits. The prefix length says how many leading bits identify the network; the rest identify the host. The subnet mask is simply those network bits set to 1. Bitwise-ANDing the address with the mask gives the network address, and setting all host bits to 1 gives the broadcast. If you want the theory, read our guides on what a subnet mask is and what an IP address is.

Tip

Remember the "minus two" rule: usable hosts equal the total addresses minus the network and broadcast addresses. A /26 has 64 total addresses but 62 usable. The special cases /31 (2 hosts, point-to-point) and /32 (a single host) are the exceptions.

Need the reverse direction or a different view? Try the CIDR to IP Range converter to see a block's first and last address, or the Subnet Mask Converter to swap between dotted masks, prefixes and wildcards.

Frequently asked questions

How do I calculate a subnet from an IP and CIDR?

Enter an address such as 192.168.1.10/24, or type the IP and pick a mask from the dropdown. The calculator applies the mask to find the network address, flips the host bits for the broadcast address, and derives the first and last usable host, wildcard mask and total host count.

Why does a /24 have 254 usable hosts instead of 256?

A /24 contains 256 total addresses, but the first one is the network address and the last is the broadcast address, so 254 are usable for real hosts. The calculator subtracts those two automatically.

What happens with a /31 or /32 subnet?

A /31 is a special point-to-point link with 2 usable addresses and no separate broadcast, and a /32 is a single host route with 1 address. The calculator handles both special cases instead of subtracting two.

Is this subnet calculator private?

Yes. Every calculation runs in your browser with JavaScript. Nothing you type is uploaded, logged or sent to any server.

Want the theory? Read the guides โ†’ ยท Visit the zoo โ†’