anındahesapla
Technology

IP Subnet and CIDR Calculation: A Network Subnetting Guide

Burak Çelik · 21 Mayıs 2026

IP Subnet and CIDR Calculation: A Network Subnetting Guide

Dividing a network into smaller, manageable pieces is one of the core skills of network management. IP subnet calculation lets you split a block of IP addresses into subnets and determine how many devices each can hold, along with the network and broadcast addresses. In this guide we cover the subnet mask, CIDR notation and host count calculation with examples. To perform these operations easily, you can use our network calculation tools.

📌 In short: CIDR notation (for example /24) tells you how many bits in the mask are reserved for the network. Usable host count = 2(32 − prefix) − 2 (the network and broadcast addresses are subtracted). A /24 network holds 256 addresses and 254 usable hosts. You can find the network address, broadcast address and host range with the IP subnet calculation tool.

What Is an IP Address and a Subnet?

An IPv4 address is a 32-bit number, usually written as four sections separated by dots (for example 192.168.1.10). Part of this address identifies the network, and another part identifies the device (host) on that network. A subnet is a method of dividing a large network into smaller logical pieces. This division both organizes network traffic and improves security, because each subnet forms a manageable unit on its own. The structure that determines which bits belong to the network and which to the host is called the subnet mask.

Subnet Mask and CIDR Notation

The subnet mask shows how much of the IP address is the network part. In classic notation it is written like 255.255.255.0; in modern CIDR (Classless Inter-Domain Routing) notation it is expressed as /24, using the number of bits reserved for the network. /24 means that the first 24 of the 32 bits are reserved for the network and the remaining 8 for the host. As the prefix value grows (for example /25, /26), the network shrinks and the number of hosts it can hold decreases. CIDR notation is the standard way to express network design briefly and clearly.

How Is the Usable Host Count Found?

To find out how many devices a subnet can hold, you use the number of bits reserved for the host:

Usable hosts = 2(32 − prefix) − 2

The "−2" here comes from two addresses in every network being reserved for special purposes: one is the network address, the other is the broadcast address; these cannot be assigned to devices. For example, in a /24 network: 2⁸ − 2 = 256 − 2 = 254 usable hosts. In a /26 network there are 2⁶ − 2 = 62 hosts. You can do this calculation instantly by entering the IP and prefix into the subnet calculation tool.

Network Address and Broadcast Address

Every subnet has two boundary addresses. The network address is the first address of the subnet and identifies that network as a whole; all bits in the host portion are zero. The broadcast address is the last address of the subnet and is used to send data to all devices on that network at once; all bits in the host portion are one. All the addresses between these two form the usable host range that can be assigned to devices. Knowing which network an IP belongs to, along with the network and broadcast addresses, is the foundation of network configuration.

Binary System and Subnetting

The binary system underlies subnet calculation. Every IP address and mask is actually a 32-bit binary number; the "1" bits in the subnet mask mark the network part and the "0" bits mark the host part. When a bitwise "AND" operation is performed between an IP address and the mask, the network address is found. That is why being able to convert decimal IPs to binary is the key to truly understanding subnet logic. You can use the number base conversion tool to convert between decimal and binary.

Why Is a Network Subnetted?

There are several practical reasons to divide a large network into subnets rather than leaving it as a single piece. In divided networks, broadcast traffic stays limited to its own subnet, which reduces unnecessary traffic and improves performance. Defining a separate subnet for each department or service allows security rules to be applied more precisely. Preventing address waste is another reason: designing subnets sized to need makes efficient use of the limited IP address pool. That is why subnet design is a fundamental step in building scalable networks.

A Practical Subnet Example

Suppose you want to divide the 192.168.1.0/24 network into four departments, each holding about 50 devices. A /26 prefix (255.255.255.192 mask) provides 62 usable hosts in each subnet, which is enough for 50 devices. The /24 network is thus split into four /26 subnets: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26. Each subnet has its own network address, broadcast address and host range. Doing this kind of planning by hand is prone to error; verifying it with a subnet calculation tool secures your design.

The Difference Between IPv4 and IPv6

The most widely used addressing system today is IPv4, and with its 32-bit structure it can produce about 4.3 billion different addresses. As the number of internet-connected devices grew rapidly, this pool began to fall short, so the 128-bit IPv6 was developed. IPv6 offers a practically inexhaustible number of addresses and uses a hexadecimal notation made up of eight groups. Subnet logic applies in both versions, but in IPv6 subnet design is more flexible because of the abundance of addresses. Since the transition takes a long time, the two systems work side by side today; most networks support both IPv4 and IPv6. A network administrator knowing the basic logic of both systems ensures they are prepared for the future.

Private and Public IP Addresses

IP addresses are divided into private and public according to their area of use. Private IP addresses (for example the 192.168.x.x, 10.x.x.x ranges) are used within home and office networks and are not routed directly on the internet; these addresses can be reused over and over in every local network. Public IP addresses, on the other hand, are unique on the internet and present your device to the outside world. Your modem performs a conversion called NAT (Network Address Translation) between the private addresses on your local network and the public address on the internet. This distinction both enables efficient use of the limited IPv4 pool and protects the local network from outside access to some degree. Subnet design is usually carried out on these private address ranges.

Variable Length Subnet Masks (VLSM)

When dividing a network, making every subnet the same size often leads to address waste. Some departments hold hundreds of devices while others need only a few; giving them all equally sized subnets creates wasted addresses in the small groups. Variable Length Subnet Masking (VLSM) offers a solution to this problem: it lets you design each subnet at a different size according to its real need. This way one size is allocated to a group of fifty devices, and a much smaller block to a two-device point-to-point link. VLSM is the fundamental method for using the limited IPv4 address pool efficiently and is a standard part of modern network design. In practice, distributing address blocks in order from the largest subnet down to the smallest prevents overlap. This approach meets both today's need and leaves room for future growth; a well-designed address plan lets the network scale smoothly for years.

Host Counts of Common CIDR Blocks

  • /30 → 4 addresses, 2 usable hosts (point-to-point link)
  • /29 → 8 addresses, 6 hosts · /28 → 16 addresses, 14 hosts
  • /27 → 32 addresses, 30 hosts · /26 → 64 addresses, 62 hosts
  • /25 → 128 addresses, 126 hosts · /24 → 256 addresses, 254 hosts
  • /23 → 512 addresses, 510 hosts · /22 → 1024 addresses, 1022 hosts

Knowing this table lets you quickly choose the smallest block suitable for the host count you need; that way you build an efficient design without wasting the address pool.

Frequently Asked Questions

How many hosts does a /24 network hold? From 256 total addresses, the network and broadcast addresses are subtracted, leaving 254 usable hosts.

What is a /30 network used for? It offers only 2 usable hosts; that is why it is ideal for point-to-point links between two routers.

Does the network grow as the mask grows? On the contrary; as the prefix grows (for example from /24 to /26), the host portion shrinks and the network holds fewer devices.

What is the difference between CIDR and the classic mask? The two carry the same information; the /24 notation is the short, modern form of the 255.255.255.0 mask.

Why can't 2 addresses be used in every network? One is the network address that identifies the network, the other is the broadcast address that broadcasts to all devices; these are not assigned to devices.

Once you grasp how the prefix separates the network and host bits and that the host count is based on powers of 2, subnet calculations cease to be complex. Thinking about the network and broadcast addresses, the usable range and the correct mask choice together is the foundation of designing networks that are both efficient and manageable. Allocating each segment only as many addresses as it needs with variable length subnets lets you use the limited pool without waste. Considering the distinction between private and public addresses and future growth keeps your design standing for years. For all your network and technology calculations, you can make use of our free calculation tools.

B

Author

Burak Çelik · Technology & Digital Editor

Burak Çelik writes blog posts on technology and digital topics. He clearly explains subjects such as data, networks, screens, time and body measurements.

All posts →

Related posts