What Are an IP Address, CIDR and a Subnet Mask? How Many Addresses Is /24? A Calculation Method
Updated: November 6, 2026 · AracMerkezi
▶ Open IP / CIDR Subnet Calculator
An IPv4 address is a network address made of 32 bits, written as four dot-separated numbers (such as 192.168.1.10); each number is between 0 and 255. CIDR notation states the size of the network by writing a number after a slash next to the address: 192.168.1.0/24. Instead of memorizing CIDR, this guide shows how to calculate by hand with the block size method and how to split a network into subnets, with examples.
What does /24 mean?
The number after the slash says how many bits of the address belong to the network part; the remaining bits are reserved for devices. /24 means the first 24 bits are the network and the last 8 bits are for devices: 2⁸ = 256 addresses. The general formula: total addresses = 2^(32 − prefix). In every network the first address is the network address and the last is the broadcast address; devices get the addresses other than these two, so usable addresses = total − 2.
| CIDR | Subnet mask | Total addresses | Usable |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
The block size method
Find the “interesting” byte of the mask (the first byte that is not 255). Block size = 256 − that byte. The network address is that byte of the address rounded down to a multiple of the block size.
Example 1: 10.20.30.77/26. The /26 mask is 255.255.255.192; the interesting byte is 192, so the block size is 256 − 192 = 64. The largest multiple of 64 at or below 77 is 64. The network address is 10.20.30.64, the broadcast address is 64 + 63 = 10.20.30.127, and the usable range is 10.20.30.65 – 10.20.30.126 (62 addresses).
Example 2: 172.16.5.200/20. The mask is 255.255.240.0; the interesting byte is the third byte (240) and the block size is 16. The multiple of 16 at or below 5 is 0. The network address is 172.16.0.0, the broadcast address is 172.16.15.255, and there are 4,094 usable addresses. A 5 in the third byte shows that the network covers the 0–15 range in that byte.
Example 3: 192.168.1.10/24. The network is 192.168.1.0, the broadcast is 192.168.1.255, and the usable range is 192.168.1.1 – 192.168.1.254 (254 addresses).
Example 4: An office plan with four sections
We will share the block 192.168.20.0/24 among four sections: 100, 50, 20 and 10 devices. Go from largest to smallest, because large blocks are less flexible given their alignment needs. 100 devices + 2 = 102 addresses, so /25 (128): 192.168.20.0/25 (0–127). For 50 devices, /26: 192.168.20.128/26 (128–191). 20 devices + 2 = 22, the nearest block is 32, so /27: 192.168.20.192/27 (192–223). 10 devices + 2 = 12, the nearest block is 16, so /28: 192.168.20.224/28 (224–239). A total of 128 + 64 + 32 + 16 = 240 addresses are used; the 240–255 range (16 addresses) stays free for later. This method is called variable-length subnet masking (VLSM) and it reduces wasted addresses.
The wildcard mask
Some network devices and access lists use the inverse of the subnet mask, the wildcard mask. You find it by subtracting each byte from 255: the wildcard equivalent of the mask 255.255.255.192 is 0.0.0.63, and for /20 (255.255.240.0) it is 0.0.15.255. A 0 in the wildcard means “this bit must match” and a 1 means “don't care”. Which device uses which is stated in its documentation; mixing them up makes the rule match the wrong scope.
Which prefix for how many devices?
Add the network and broadcast addresses to the device count, then round up. For 50 devices you need 50 + 2 = 52 addresses; the smallest block that fits is 64, which is /26 (62 usable). For 100 devices, /25 (126) is enough. To leave room for growth most teams pick the next block up; that is a choice, not a rule.
Splitting into subnets
To split a /24 network into four equal parts you lengthen the prefix by two bits (/24 → /26). 192.168.10.0/24 splits into these four networks: 192.168.10.0/26, 192.168.10.64/26, 192.168.10.128/26 and 192.168.10.192/26. Each has 62 usable addresses; the total is 4 × 62 = 248, so 6 usable addresses are lost to network and broadcast addresses during the split. Subnet boundaries are multiples of the block size; the address 192.168.10.100 belongs to the second network (64–127).
Is an address inside this network?
Question: is 192.168.1.200 in the network 192.168.1.128/25? The /25 block size is 128; the network spans 128–255, so yes. 192.168.1.100, on the other hand, is in the 0–127 range and is not in this network. This is the check made most often when writing a firewall rule.
Private and special-purpose ranges
Ranges that are not routed directly on the internet and are used in home and corporate networks:
- 10.0.0.0/8
- 172.16.0.0/12 (172.16.x.x – 172.31.x.x)
- 192.168.0.0/16
In addition, the 127.0.0.0/8 range points to your own device (localhost), and 169.254.0.0/16 is the link-local range assigned automatically when no address can be obtained. /32 denotes a single address and /31 denotes two-end point-to-point links (RFC 3021); the “−2” rule above does not apply to these two prefixes as is.
Common mistakes
- Taking usable addresses for total addresses; network and broadcast addresses are not given to devices.
- Thinking the network grows as the prefix gets longer. /16 is larger than /24; the smaller the prefix, the larger the network.
- Starting subnet boundaries from an address that is not a multiple of the block size (for example, writing 192.168.10.100/26 and assuming it is the network address).
- Forgetting that cloud providers reserve a few addresses in every subnet; check the provider's documentation for how many are reserved.
- Overlapping ranges. If the blocks chosen for an office network and a VPN overlap, traffic goes to the wrong place.
Mini glossary
- Prefix: The number of network bits after the slash.
- Subnet mask: The 32-bit number in which network bits are written as 1 and device bits as 0.
- Broadcast address: The last address, which reaches all devices on the network.
- Block size: The difference between the starts of two consecutive subnets.
If you wonder why numbers like 255 and 192 appear in masks, the guide on binary, decimal and hexadecimal number systems shows the 11000000 = 192 example. To see all values in one step, use the IP / CIDR Subnet Calculator; the tool supports IPv4 only.
Frequently asked questions
How many IP addresses is /24?
256 addresses; 254 are usable, excluding the network and broadcast addresses.
What is the /24 subnet mask?
255.255.255.0.
Which CIDR block is enough for 50 devices?
50 devices plus the network and broadcast addresses need 52 addresses; the smallest block that is enough is /26 (64 addresses, 62 usable).
Tools mentioned in this guide
More guides
- What Is chmod? Linux File Permissions 755, 644 and 777 Explained: Reading ls -l, umask and Examples – What is chmod? Read ls -l output, understand 755 644 600 777, symbolic mode, umask and special bits. Commands were run and verified.
- What Are HTTP Status Codes? 200, 301, 404, 500 and Troubleshooting – What do HTTP status codes mean? Codes 200, 301, 404, 500, testing with curl, the cost of redirect chains, soft 404s and site-migration examples.
- What Is Regex (a Regular Expression)? A Beginner's Guide with Tested Examples and Common Mistakes – What is regex, and what do \d \w + * [] () mean? Date, phone and email examples, greedy matching, the Turkish letter issue and a ReDoS warning.
- What Are the Most Common Port Numbers? 22, 80, 443, 3306, and More – What is a port, and how do TCP and UDP differ? A table of common ports such as SSH 22, HTTP 80, HTTPS 443, and MySQL 3306, plus basic port security tips.
- What Is curl? Basic Flags and Converting a curl Command to fetch – What is curl and what do the -X, -H and -d flags do? A POST request example, the JavaScript fetch equivalent of a curl command, and debugging tips.
This article is for general information only and is not legal, financial or medical advice. We are not an official institution.