IPv4 subnet calculator (CIDR)
Compute network address, broadcast, mask and host count from an IP and CIDR prefix.
How the calculation works
The CIDR prefix (e.g. /24) defines the mask. The network address is IP AND mask; the broadcast fills the host bits with 1. Usable hosts = 2^(32−prefix) − 2.
Examples
- /24 (255.255.255.0): 256 addresses, 254 usable hosts.
- /30: only 2 hosts — used for point-to-point router links.
Frequently asked questions
Why "− 2" hosts?
One address is the network and another is the broadcast; neither can be assigned to a host.
What is the CIDR prefix (/24)?
How many IP bits define the network. /24 = 24 network bits and 8 host bits, giving 256 addresses.
Why divide into subnets?
To organize and isolate parts of the network, improve security and reduce broadcast traffic.
Why does a /24 have 254 hosts, not 256?
Two addresses are reserved: the network address and the broadcast. In practice the gateway takes a third.
What are the private IP ranges?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are never routed on the internet, so many homes share 192.168.0.1.
Which prefix should I choose?
Count devices and leave room. A /24 (254 hosts) suits homes and small offices; larger networks benefit from segmentation.
Related calculators
More Tech / IT calculators
See all →Download time
Calculate how long a file takes to download at your internet speed.
Password strength
Estimate password entropy (bits) and crack time from length and character types.
HEX ↔ RGB color
Convert colors between HEX (#RRGGBB) and RGB formats.
Aspect ratio
Find the aspect ratio (e.g. 16:9) of an image or screen and resize keeping the proportion.
Password generator
Create strong, random passwords with the length and character types you choose. Generated in your browser — nothing is sent.
Pixel density (PPI)
Calculate a screen's pixels per inch (PPI) from its resolution and diagonal size.
Uptime / SLA
Find out how much downtime an uptime SLA allows per year, month, week and day.
Color contrast (WCAG)
Calculate the contrast ratio between two colors and see if it passes WCAG accessibility criteria.
Updated on June 18, 2026 · by Rafael Rossi · Methodology & sources