IPv4 subnet calculator (CIDR)
A /24 IPv4 subnet holds 256 addresses, 254 of them usable by hosts, and every extra prefix bit halves that. Enter an address with a prefix or a netmask to get the network and broadcast addresses, the usable range, the wildcard mask and the host count.
Network
192.168.1.0/24
254 usable hosts · 256 addresses
- Network address
- 192.168.1.0
- Broadcast address
- 192.168.1.255
- Netmask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- First usable host
- 192.168.1.1
- Last usable host
- 192.168.1.254
- Usable hosts
- 254
- Total addresses
- 256
- Address range
- 192.168.1.0 – 192.168.1.255
- Address type
- Private-use (RFC 1918)
- Address in binary
- 11000000.10101000.00000001.00001010the first 24 bits are the network, the other 8 the host
- Netmask in binary
- 11111111.11111111.11111111.00000000
- Network in CIDR notation
- 192.168.1.0/24
How do you calculate a subnet from CIDR notation?
The prefix after the slash says how many leading bits of the address name the network; the remaining bits number the hosts. A /24 keeps 24 network bits and leaves 8 host bits, so it holds 2⁸ = 256 addresses, and its netmask is 24 one-bits followed by 8 zero-bits: 255.255.255.0.
The network address is the address with every host bit set to 0, and the broadcast address has every host bit set to 1. Neither can be given to a host, so a subnet has 2 fewer usable addresses than its size: 254 in a /24 and 2 in a /30. A /31 is the exception, because RFC 3021 lets a point-to-point link use both of its addresses, and a /32 is one single address.
The wildcard mask is the netmask with every bit flipped, 0.0.0.255 for a /24; router access lists use it to mark the bits that may vary. The calculator also says whether the address sits in a range set aside for a special purpose, such as private-use 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 from RFC 1918, or 100.64.0.0/10 for carrier-grade NAT; anything outside those ranges is labelled public.
addresses = 2^(32 − prefix) usable hosts = addresses − 2 (/31 = 2, /32 = 1) network = address AND netmask broadcast = network OR wildcard mask
How many hosts are in each subnet size?
| Prefix | Netmask | Wildcard mask | Addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (point-to-point, RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (single host) |
How to calculate an IPv4 subnet
- 1Enter the address and its sizeType an IPv4 address with a prefix, like 192.168.1.10/24, or with a netmask, like 192.168.1.10 255.255.255.0.
- 2Read the networkThe result gives the network and broadcast addresses, the first and last usable host, and how many hosts fit.
- 3Copy the masksCopy the netmask, the wildcard mask or the network in CIDR notation for your router or cloud network settings.
- 4Split it if you need toPick a longer prefix under “Split it into smaller subnets” to list the subnets of that size inside the network.
Frequently asked questions
How many usable hosts are in a /24, /27 or /30 subnet?
Why are two addresses subtracted from every subnet?
What is a wildcard mask?
Are IP address classes A, B and C still used?
Which IPv4 address ranges are private?
Sources
- RFC 4632, Classless Inter-domain Routing (CIDR) — prefix notation and the end of class A/B/C (checked 20 Oct 2026)
- RFC 1918, Address Allocation for Private Internets (checked 20 Oct 2026)
- RFC 3021, Using 31-Bit Prefixes on IPv4 Point-to-Point Links (checked 20 Oct 2026)
- RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space (100.64.0.0/10) (checked 20 Oct 2026)
- RFC 1122, Requirements for Internet Hosts, §3.2.1.3 (network, broadcast and loopback addresses) (checked 20 Oct 2026)
- IANA IPv4 Special-Purpose Address Registry (checked 20 Oct 2026)
- IANA IPv4 Multicast Address Space Registry (224.0.0.0 to 239.255.255.255) (checked 20 Oct 2026)
- inet_aton(3), Linux manual page (a leading 0 makes a part octal) (checked 20 Oct 2026)
- Cisco, Configure and Filter IP Access Lists (wildcard masks) (checked 20 Oct 2026)
Need a custom dev tool for your team?
We build internal tools, dashboards, APIs, and SaaS platforms. If you can describe it, we can ship it.
Built by CountryDevs · No signup · No ads · We count visits, never what you enter