NETWORK

Subnet Calculator

IPv4 network details from any address and prefix length.

What is a subnet calculator?

A subnet calculator takes an IPv4 address and a CIDR prefix length and computes the network details: network address, broadcast address, subnet mask, wildcard mask, usable host range and host count. A CIDR calculator answers questions like "how many addresses does a /26 give me?" without manual binary math, and an IP subnet mask reference tells you which bits belong to the network and which to hosts. It is aimed at network admins, students and anyone planning address ranges.

How Subnet Calculator works

Enter an IPv4 address (for example 192.168.1.10) and a CIDR prefix from 0 to 32, then click Calculate. Everything runs as pure client-side math in your browser: it converts the address and prefix to binary, derives the network address (host bits zeroed), the broadcast address (host bits set), the subnet mask, the wildcard mask (mask inverted), the first and last usable hosts, and the host count. Edge cases are handled correctly: /31 networks use both addresses per RFC 3021 (no broadcast), and /32 is a single host.

The math behind it

The subnet mask has the first n bits set to 1, where n is the prefix length. The network address is the IP with all host bits cleared; the broadcast address has all host bits set. Usable hosts = 232−n − 2 for prefixes below /31.

Worked example: 192.168.1.10/24. The mask is 255.255.255.0 (24 ones). Network address: 192.168.1.0 (last octet zeroed). Broadcast: 192.168.1.255 (last octet all ones). Usable host range: 192.168.1.1 – 192.168.1.254. Host count: 28 − 2 = 254 usable addresses.

Common uses

Is it safe to use?

Yes — the calculation runs fully in your browser with plain JavaScript; the IP address and prefix you enter are never sent to our servers or stored anywhere. You can even disconnect from the internet after the page loads and it keeps working. There is no account, no logging, nothing to leak.

Tips

Frequently asked questions

How do I calculate a subnet manually?

Write the IP and mask in binary, keep the network bits and zero the host bits for the network address; set the host bits to 1 for the broadcast address. Usable hosts are the addresses between them, and the count is 2^(host bits) − 2.

What is CIDR notation?

CIDR writes an address and prefix together, like 10.0.0.0/8. The number after the slash is the count of network bits; the rest are host bits. Larger prefixes mean smaller networks.

How many hosts are in a /24, /25 or /26?

A /24 has 256 addresses with 254 usable, a /25 has 128 with 126 usable, and a /26 has 64 with 62 usable. Each extra bit halves the address space.

What is special about /31 and /32 subnets?

A /31 has only two addresses, both usable for point-to-point links under RFC 3021 (no network or broadcast address). A /32 denotes a single host, typically used in routing tables and loopback addresses.

What is the difference between a subnet mask and a wildcard mask?

The subnet mask marks network bits with 1s; the wildcard mask is its inverse, marking host bits with 1s. Wildcard masks are used in access-control lists on some router platforms.

Is my entered IP address sent to a server?

No. This calculator runs entirely in your browser. The address and prefix never leave your device, so it is safe to use with internal or sensitive network plans.

Check which address your connection presents with our IP Address Checker, or test whether a host is reachable with our Website Down Checker.