IP calculators

IPv4 subnet calculator

Enter an IP with its prefix (192.168.1.10/24) or its mask and get the network, broadcast, usable range and number of hosts.

Prefix (CIDR) and mask table

CIDRMaskAddressesUsable hosts
/32255.255.255.25511
/31255.255.255.25422
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254
/23255.255.254.0512510
/22255.255.252.01.0241.022
/21255.255.248.02.0482.046
/20255.255.240.04.0964.094
/19255.255.224.08.1928.190
/18255.255.192.016.38416.382
/17255.255.128.032.76832.766
/16255.255.0.065.53665.534
/15255.254.0.0131.072131.070
/14255.252.0.0262.144262.142
/13255.248.0.0524.288524.286
/12255.240.0.01.048.5761.048.574
/11255.224.0.02.097.1522.097.150
/10255.192.0.04.194.3044.194.302
/9255.128.0.08.388.6088.388.606
/8255.0.0.016.777.21616.777.214

What does it do?

Calculates everything about an IPv4 subnet from an IP with its prefix (192.168.1.10/24) or mask: the network address, broadcast, first and last host, number of usable hosts, mask, wildcard and their binary form.

Why does it matter?

Assigning IPs without getting the subnet right leads to hard-to-find mistakes: devices that can't see each other, out-of-range IPs or duplicate addresses. It's a calculation done every day when configuring routers, firewalls and servers, and an easy one to get wrong in your head.

How does it work?

The prefix says how many bits of the address belong to the network. The mask is applied to the IP (an AND operation) to get the network, the host bits are set to get the broadcast, and the usable range sits in between. Everything is calculated in your browser, instantly and without sending anything to the server. /31 and /32 follow RFC 3021 (point-to-point links and single hosts).

How to read the result

Network
The first address: it identifies the subnet. It isn't assigned to devices.
Broadcast
The last address: it reaches every device in the subnet. It isn't assigned either.
First and last host
The range you can assign to devices.
Wildcard
The inverted mask, used in Cisco access lists and OSPF.

What is it for?

Frequently asked questions

How many hosts does a /24 have?

256 addresses, of which 254 can be assigned to devices (the network and broadcast are excluded).

What's the difference between /24 and 255.255.255.0?

None: they're two ways of writing the same mask. /24 means 24 bits set to 1.

What are /30 and /31 for?

Point-to-point links between two routers. A /30 has 2 usable hosts; a /31 (RFC 3021) uses both addresses and wastes none.

Does it work with IPv6?

For IPv6, use the IPv6 calculator, which shows the range and how many /64s it contains.