IP Subnet Calculator (IPv4 and CIDR)
Fast, accurate and free online podsieci calculator tool running directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulIP subnet calculator - the basis for designing computer networks
Address space management in computer networks requires precise mathematical calculations based on the binary system. Subnetting, i.e. dividing one large physical network into smaller logical subnets, is a key element of the work of every system administrator and network engineer. It allows you to increase security (traffic separation), improve performance (limiting the broadcast domain) and optimize costs by eliminating the waste of free IP addresses. Our IP subnet calculator is an interactive online tool that performs these complex calculations in a fraction of a second.
Just enter any IP address (e.g. 192.168.1.1) and select the subnet mask (in the traditional decimal format or the shortened CIDR notation). The calculator will automatically determine the full structure of the network: its base address, broadcast address, exact mask in decimal and binary format, the number of usable hosts and the full range of addresses that can be assigned to end devices.
IP address classes and CIDR notation
Historically, IPv4 addresses were divided into rigid classes. Nowadays, flexible classless addressing (CIDR – Classless Inter-Domain Routing) is used. The following table shows the traditional IP address class division:
| Network Class | First Octet Range | Default Subnet Mask | Maximum Number of Networks | Maximum Number of Hosts in a Network |
|---|---|---|---|---|
| Class A | 1 – 126 | 255.0.0.0 (/8) | 128 | 16 777 214 |
| Class B | 128 – 191 | 255.255.0.0 (/16) | 16 384 | 65 534 |
| Class C | 192 – 223 | 255.255.255.0 (/24) | 2,097 152 | 254 |
| Class D (Multicast) | 224 – 239 | No mask defined | Reserved for multicast | — |
| Class E (Experimental) | 240 – 254 | No mask defined | Reserved for research and future | — |
Key parameters calculated for subnetting
Subnetting is based on the analysis of the following logical values:
- Network Address:The first address in the subnet in which all bits of the host part are set to 0. It is used to identify the network in the routing tables and cannot be assigned to any device.
- Broadcast Address:The last address in a given subnet in which all host bits are set to 1. Sending a packet to this address causes the packet to be delivered to all hosts in that subnet.
- Subnet Mask:A 32-bit number used to separate the network address from the host address. Bits set to 1 denote the network part and bits set to 0 denote the host part.
- Host Range (Usable IP Range):All IP addresses between the network address and the broadcast address. The number of usable addresses is always \(2^n - 2\), where \(n\) is the number of bits allocated to hosts.
How to calculate subnet step by step? The
administrator algorithm calculates subnets by bitwise ANDing the IP address and subnet mask in binary form. Here is the procedure:
- Convert the IP address and mask to binary:Write each of the four octets of the IP address and mask in 8-bit binary number format (e.g. 192 to 11000000).
- Determine the network address (AND operation):Perform logical multiplication (bit conjunction) of the IP address and the subnet mask. Wherever there is a 1 in the mask, you rewrite the IP address bit; where there is a 0 in the mask, you enter 0. Convert the resulting binary result back to the decimal system.
- Determine the broadcast address:Take the received binary network address and change all the bits belonging to the host part (those that are 0 in the mask) to ones (1). Convert the result to the decimal system.
- Calculate the number of available hosts:Count the number of zero bits in the subnet mask. This number (\(n\)) will be used for the formula \(2^n - 2\). We subtract 2 addresses because the first (network address) and last (broadcast address) are reserved.
Frequently asked questions (FAQ)
What does IP with a slash, e.g. /24, mean?
This is CIDR (Classless Inter-Domain Routing) notation. The number after the slash indicates the number of subnet mask bits set to 1 (network part). For example, the notation /24 means a mask consisting of 24 ones and 8 zeros, which in the decimal system corresponds to a mask of 255.255.255.0.
Why do we always subtract 2 from the formula for the number of hosts?
We subtract two addresses because in each subnet the first address (e.g. 192.168.1.0 with a /24 mask) is the address of the network itself, and the last address (192.168.1.255) is the broadcast address. None of these addresses can be assigned to a computer, printer or router.
What is the return address (localhost) in IPv4?
The loopback address is used to test the TCP/IP protocol stack on the local computer without sending packets to the physical network. The entire 127.0.0.0/8 subnet is reserved for this purpose, and the most common loopback address is 127.0.0.1.
What are Private IP Addresses (RFC 1918)?
These are pools of addresses intended exclusively for use in local area networks (LANs). Packets with these addresses are not routed on the public Internet. These ranges are: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
What is a Wildcard Mask?
The wildcard mask is the inverse of the standard subnet mask - bits equal to 0 denote the network part, and bits equal to 1 denote the host part. It is calculated by subtracting the subnet mask from 255.255.255.255 (e.g. for mask 255.255.255.0 the wildcard mask is 0.0.0.255). It is mainly used in the configuration of access lists (ACLs) in Cisco devices.