CalcCafe

IP Subnet Calculator

Calculate the network address, broadcast, subnet mask, host range, and host count for any IPv4 address and CIDR prefix.

Network address
-
-
Subnet mask
-
Broadcast
-
Usable host range
-
Usable hosts
-
Total addresses
-
Wildcard mask
-

Enter an address like 10.0.0.5 and a prefix from 0 to 32.

Example

For 192.168.1.10/24: network 192.168.1.0, mask 255.255.255.0, broadcast 192.168.1.255, usable range 192.168.1.1 - 192.168.1.254, and 254 usable hosts (256 total addresses).

How it works

The /prefix builds a 32-bit subnet mask (the top N bits set). Network = IP AND mask; broadcast = network OR (NOT mask). Usable hosts are the addresses between network+1 and broadcast-1, giving 2^(32-prefix) total and 2^(32-prefix)-2 usable (with /31 and /32 handled as special cases).

Good to know

This IP Subnet Calculator turns an IPv4 address and a CIDR prefix (like 192.168.1.10/24) into the full picture of a subnet: the network address, subnet mask, wildcard mask, broadcast address, the first-and-last usable host range, the count of usable hosts, and the total address count. It also tags the address with its legacy class (A through E based on the first octet). It is built for network admins, students studying for certifications like the CCNA, developers setting up VPCs or firewall rules, and anyone who needs to plan or verify an address block quickly.

Reach for it whenever you are carving a larger network into smaller pieces, double-checking which range a device should sit in, writing access-control or routing entries, or sizing a subnet for a known number of hosts. Because the prefix determines everything, you can change the /n value and instantly see how the block doubles or halves: each step from /24 to /25 splits the usable hosts roughly in half, while moving toward /16 grows them dramatically.

To read the result, start with the network address (the lowest address, all host bits zero) and the broadcast (the highest, all host bits one) — these two bracket the block but cannot be assigned to a device. Everything between them is your usable host range. The wildcard mask is simply the inverse of the subnet mask and is what tools like ACLs and OSPF expect instead of a normal mask. Confirm the total-addresses figure equals 2 raised to (32 minus the prefix) to sanity-check your prefix choice.

One practical caveat: the host you typed does not have to be the network address. The calculator masks whatever IP you enter down to its containing network, so 192.168.1.10/24 and 192.168.1.200/24 both report the same 192.168.1.0 network. Watch for the special cases — a /31 reports 2 usable addresses for point-to-point links and a /32 reports a single host — and remember the class label is historical context only; modern routing is classless and driven entirely by the prefix.

Frequently asked questions

Why does a /24 give 254 usable hosts instead of 256?
A /24 contains 256 total addresses, but the first (network address) and last (broadcast address) are reserved, leaving 256 - 2 = 254 addresses you can actually assign to hosts.
How are /31 and /32 handled?
A /32 describes a single host with no broadcast, so it shows 1 usable address. A /31 (RFC 3021) is used for point-to-point links where both of its 2 addresses are usable, so no addresses are reserved.
Is my data uploaded anywhere?
No — this calculator runs entirely in your browser. Your inputs never leave your device, and it works offline once loaded.
Is this calculator free?
Yes, completely free with no sign-up and no limits.

People also ask

What does the /24 in an IP address mean?
The number after the slash is the CIDR prefix length: it states how many of the 32 bits are the network portion. A /24 means the first 24 bits identify the network, leaving 8 bits (256 addresses) for hosts.
How do I calculate the number of hosts in a subnet?
Total addresses equal 2 raised to the power of (32 minus the prefix). Subtract 2 for the network and broadcast addresses to get usable hosts, so a /26 has 2^6 = 64 total and 62 usable.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask marks the network bits with 1s (for example 255.255.255.0), while a wildcard mask is its bit-for-bit inverse (0.0.0.255). Wildcard masks are used by tools such as Cisco access control lists and OSPF network statements.
How do I convert a subnet mask to CIDR notation?
Count the number of consecutive 1 bits in the mask from the left. 255.255.255.0 has 24 ones, so it is /24; 255.255.255.192 has 26 ones, so it is /26.
What is the broadcast address of a subnet?
It is the highest address in the block, where every host bit is set to 1. Packets sent to it reach all hosts on that subnet, and it cannot be assigned to an individual device.
What are the private IPv4 address ranges?
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for private use. These addresses are not routable on the public internet and are commonly used inside home and corporate networks.
Can this calculator handle IPv6 addresses?
No, this tool works with IPv4 addresses and prefixes from /0 to /32 only. IPv6 uses 128-bit addresses and different notation, so it requires a separate IPv6 subnet calculator.
Why can't I assign the first and last address in a subnet?
The first address is the network identifier and the last is the broadcast address, both of which are reserved by the IP standard. The exceptions are /31, where both addresses are usable for point-to-point links, and /32, which represents a single host.

Related calculators