๐ŸŒ IP Subnet / CIDR Calculator

Subnet Mask255.255.255.0
Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Total Addresses256
Usable Hosts254

Enter an IPv4 address with a CIDR prefix (e.g. 192.168.1.10/24) to instantly calculate the subnet mask, network and broadcast addresses, first and last usable host, and total/usable address counts. Handy for network design, subnetting practice, and troubleshooting.

How to use

  1. Enter an IPv4 address in CIDR notation (e.g. 192.168.1.10/24) in the "IP Address / Prefix" field.
  2. The subnet mask, network address, and broadcast address are calculated automatically.
  3. Check the usable host range and total address count.

How the calculation works

An IPv4 address is a 32-bit number, and a CIDR prefix such as "/24" says how many leading bits form the network part. With /24, the first 24 bits are the network and the remaining 8 are for hosts. The calculation is bitwise. The subnet mask has the first prefix-length bits set to 1. ANDing the address with the mask (keeping only bits set in both) gives the network address; setting all the host bits to 1 gives the broadcast address. With n host bits there are 2โฟ addresses in total. On ordinary networks, the network and broadcast addresses are not assigned to devices, so usable hosts are the total minus two. /31 is a special case defined in RFC 3021 for two-device point-to-point links, and /32 denotes a single address.

Worked example

192.168.1.100/26 Subnet mask: 255.255.255.192 (first 26 bits set) Network address: 192.168.1.64 Broadcast address: 192.168.1.127 Usable hosts: 192.168.1.65 โ€“ 192.168.1.126 Total addresses: 2โถ = 64; usable hosts: 62 At /26, 192.168.1.0โ€“255 splits into four subnets: 0โ€“63, 64โ€“127, 128โ€“191 and 192โ€“255.

Things to be aware of

  • If you omit the prefix, /24 is assumed.
  • /31 and /32 are special cases and show zero usable hosts.
  • For IPv6, use the IPv6 subnet calculator.
  • Cloud providers often reserve some addresses in each subnet, so fewer may be usable.

FAQ

What format should I enter?

Enter an IPv4 address followed by a slash and prefix length, e.g. 192.168.1.10/24. If you omit the prefix, /24 is assumed.

Why do /31 and /32 show 0 usable hosts?

A /32 identifies a single address with no room for network/broadcast addresses, and a /31 (per RFC 3021) is a special two-address point-to-point case โ€” neither has the usual usable-host range.

How is this used in network design?

Work out the prefix length you need from the required host count, then check the network address, broadcast address, and usable host range that prefix actually gives you.

Is this useful for learning subnetting?

Yes โ€” try different prefix lengths and watch how the subnet mask and usable host count change, which builds intuition for subnetting.

Is my IP address sent to a server?

No, all calculation happens in your browser and nothing is sent externally.