IP Subnet Calculator
Every device on an IPv4 network needs an address, and every network needs to know exactly where it starts and ends. Subnetting is how a large block of IP addresses gets split into smaller, manageable networks — the technique behind everything from home Wi-Fi routers to enterprise data centers. This calculator takes any IPv4 address and a CIDR prefix length and instantly works out the network address, broadcast address, subnet mask, and the exact range of host addresses you can actually assign to devices.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation writes a network as an IP address followed by a slash and a prefix length — the number of leading bits that are fixed as the "network" portion of the address. For example, 192.168.1.0/24 means the first 24 bits (the first three octets) identify the network, leaving the remaining 8 bits free to number individual hosts.
The formulas
An IPv4 address is a 32-bit number, so once you fix a prefix length, everything else follows from simple binary arithmetic.
Subnet mask — the prefix length worth of 1-bits, followed by 0-bits, written in dotted-decimal form. For /24, that's 11111111.11111111.11111111.00000000, i.e. 255.255.255.0.
Network address — the IP address with the host bits zeroed out (a bitwise AND with the subnet mask):
Broadcast address — the network address with every host bit set to 1 (a bitwise OR with the inverted mask, called the wildcard mask):
Total addresses in the block:
Usable host addresses — every address in the block except the network address (which identifies the subnet itself) and the broadcast address (which targets every host at once):
The /31 and /32 prefixes are special cases handled separately: a /31 has no room for a distinct network/broadcast pair and is used for point-to-point links (both of its 2 addresses are usable), while a /32 identifies a single host.
Worked example
Take 192.168.1.10/24:
- Subnet mask:
255.255.255.0 - Network address:
192.168.1.0(host bits zeroed) - Broadcast address:
192.168.1.255(host bits set to 1) - Total addresses: 2²⁴ᐟ⁽³²⁻²⁴⁾ = 2⁸ = 256
- Usable hosts: 256 − 2 = 254, ranging from
192.168.1.1to192.168.1.254
How to use this calculator
- Enter any IPv4 address that falls inside the subnet you want to inspect, e.g.
192.168.1.10. - Enter the CIDR prefix length (0–32) — this is the number after the slash, e.g.
24. - Click Calculate Subnet to see the network address, broadcast address, subnet mask, wildcard mask, usable host range, total address count, and classful IP class, all laid out in a single table.
This is handy for configuring routers and firewalls, planning IP address allocation for a new network, checking whether two hosts fall in the same subnet, or simply understanding what a given /prefix actually means in practice.