Kulkalotar
Math & Conversion

IPv4 Subnet Calculator (CIDR)

Calculate subnet mask, network address, broadcast, usable hosts, and IP range from any CIDR notation.

Subnet mask
255.255.255.0
Network
192.168.1.0
Broadcast
192.168.1.255
First host
192.168.1.1
Last host
192.168.1.254
Usable
254

What this calculates

Subnetting math comes up constantly in networking, cloud infrastructure, and home network setup. Given a network in CIDR notation (like 192.168.1.0/24), this calculator returns the subnet mask, network/broadcast addresses, usable host range, and total usable IPs — everything you need to plan a network or fill out a router config.

Formula & how it works

CIDR /n means n bits for network, (32 − n) bits for host. Total IPs in subnet = 2^(32−n). Usable hosts = total − 2 (subtract network address + broadcast). /24 = 256 total, 254 usable. /30 = 4 total, 2 usable (point-to-point links). /32 = 1 IP (host only). RFC 1918 private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.

Worked example

192.168.1.50/24. Mask: 255.255.255.0. Network: 192.168.1.0. Broadcast: 192.168.1.255. First host: 192.168.1.1. Last host: 192.168.1.254. Usable: 254. Same IP at /28: mask 255.255.255.240, network 192.168.1.48, broadcast 192.168.1.63, usable 14 hosts (.49 through .62).

Frequently asked questions

Why subtract 2 from total?

Network address (all-zero host bits) and broadcast address (all-one host bits) can't be assigned to a device. So a /24 with 256 addresses has 254 usable. Modern routing (CIDR + RFC 3021) allows /31 with 0 'wasted' addresses for point-to-point links.

Common subnet sizes?

/24 (256, home/small office). /23 (512). /22 (1024). /16 (65,536). /8 (16.7M). Cloud VPCs (AWS, GCP) typically /16 to /20. Container subnets often /24 to /28.

What's a /32?

Single IP address. Often used in routing tables for individual host routes, or in security rules referencing one specific machine. AWS security groups allow /32 source IPs for whitelisting.

IPv6 difference?

IPv6 uses /64 as the standard subnet size — vastly larger (18 quintillion addresses per subnet). No subnet exhaustion issues. Different math but conceptually similar. This calculator handles IPv4 only.

Last updated:

Related calculators