Work out network address, broadcast, host range and host count from an IPv4 address and CIDR or mask, split into subnets, and find the CIDR for a host count.
If you already have a mask, convert it to a prefix length: 255.255.255.0 → /24
IPv4 only. A /31 is a point-to-point link (RFC 3021) that uses both addresses, and a /32 points to a single host.
Values are calculated only in this browser and never sent to a server.
Related searches
Subnet Calculator
subnet calculator online
subnet calculator tool
subnet calculator for /22
subnet calculator for /27
subnet calculator /28
subnet calculator /27
What is Subnet Calculator?
Calculates the network address, broadcast address, usable host range and count from an IP address plus a CIDR prefix or subnet mask. It also helps split a large network into smaller subnets.
How to use
1
Enter an IP address and CIDR such as 192.168.1.10/24 (or a mask such as 255.255.255.0).
2
Check the network, broadcast and host range.
3
If needed, enter a longer prefix length to split into subnets.
Tips
The mask 255.255.255.0 is the same as /24; count the 1 bits to get the prefix length.
Leave room for growth. Allow 1.5 to 2 times the number of hosts you need today.
Frequently asked questions
QWhy are there two fewer usable hosts than total addresses?
The first address is the network address and the last is the broadcast address. /31 and /32 are exceptions.
QDoes it handle IPv6?
Only IPv4 is supported for now.
Learn more
1CIDR notation and the subnet mask
In 192.168.1.0/24, /24 means the first 24 bits identify the network. Written as a subnet mask, it is 255.255.255.0. The remaining 32−24=8 bits are for hosts (devices), so there are 256 addresses, and subtracting the first (network address) and the last (broadcast address) leaves 254 usable hosts.
In the same way, /26 gives 62, /22 gives 1,022 and /16 gives 65,534. The number of hosts is 2^(32−prefix)−2.
2Example: splitting 192.168.1.0/24 into 4
Splitting a /24 into four /26 subnets gives network addresses 192.168.1.0, 192.168.1.64, 192.168.1.128 and 192.168.1.192, each with 62 usable hosts. In the first subnet the usable range is 192.168.1.1 to 192.168.1.62 and the broadcast address is 192.168.1.63.
When you enter an address and CIDR (or subnet mask), this tool calculates the network address, broadcast address, host range and count, and splits it into subnets of the length you want.
3Good to know
The private address ranges used inside home or office networks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. A /31 is an exceptional size used to connect two devices directly, and a /32 points to a single address.
Cloud services may reserve a few addresses at the start of a subnet themselves, so check the service documentation for the number you can actually use.
4CIDR quick reference
Each time the prefix length increases by 1, the number of addresses is cut in half. This table covers most common cases at a glance.
The usable host count is the total number of addresses minus the network address and broadcast address.
/16
Subnet mask
255.255.0.0
Total addresses
65,536
Usable hosts
65,534
/22
Subnet mask
255.255.252.0
Total addresses
1,024
Usable hosts
1,022
/23
Subnet mask
255.255.254.0
Total addresses
512
Usable hosts
510
/24
Subnet mask
255.255.255.0
Total addresses
256
Usable hosts
254
/25
Subnet mask
255.255.255.128
Total addresses
128
Usable hosts
126
/26
Subnet mask
255.255.255.192
Total addresses
64
Usable hosts
62
/27
Subnet mask
255.255.255.224
Total addresses
32
Usable hosts
30
/28
Subnet mask
255.255.255.240
Total addresses
16
Usable hosts
14
/29
Subnet mask
255.255.255.248
Total addresses
8
Usable hosts
6
/30
Subnet mask
255.255.255.252
Total addresses
4
Usable hosts
2
CIDR
Subnet mask
Total addresses
Usable hosts
/16
255.255.0.0
65,536
65,534
/22
255.255.252.0
1,024
1,022
/23
255.255.254.0
512
510
/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
5What input formats can I use?
You can enter a prefix length after a slash, or enter a subnet mask after a space.
If you enter only an IP address, it is treated as a single host (/32). To calculate a range, include a prefix or subnet mask.
Slash notation, such as 192.168.1.10/24
IP address + space + mask, such as 192.168.1.10 255.255.255.0
Entering only 192.168.1.10 is treated as /32
A mask must have all the 1s first, followed by all the 0s.
6Which IP address ranges are private?
There are three ranges reserved for private networks that are not directly connected to the internet: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. They are defined in RFC 1918.
That's why devices behind a home router often get addresses starting with 192.168. This tool also identifies the type of address you enter.
10.0.0.0/8
Address range
10.0.0.0 ~ 10.255.255.255
Purpose
Private (large organizations, cloud)
172.16.0.0/12
Address range
172.16.0.0 ~ 172.31.255.255
Purpose
Private
192.168.0.0/16
Address range
192.168.0.0 ~ 192.168.255.255
Purpose
Private (home, small networks)
100.64.0.0/10
Address range
100.64.0.0 ~ 100.127.255.255
Purpose
Carrier-grade NAT (CGNAT)
169.254.0.0/16
Address range
169.254.0.0 ~ 169.254.255.255
Purpose
Automatic link-local address
127.0.0.0/8
Address range
127.0.0.0 ~ 127.255.255.255
Purpose
Loopback (this device)
Range
Address range
Purpose
10.0.0.0/8
10.0.0.0 ~ 10.255.255.255
Private (large organizations, cloud)
172.16.0.0/12
172.16.0.0 ~ 172.31.255.255
Private
192.168.0.0/16
192.168.0.0 ~ 192.168.255.255
Private (home, small networks)
100.64.0.0/10
100.64.0.0 ~ 100.127.255.255
Carrier-grade NAT (CGNAT)
169.254.0.0/16
169.254.0.0 ~ 169.254.255.255
Automatic link-local address
127.0.0.0/8
127.0.0.0 ~ 127.255.255.255
Loopback (this device)
7How to calculate the network and broadcast addresses without a calculator
Find the block size using the last octet, then identify the start and end of the block containing your address. The block size is 256 minus the relevant subnet-mask octet.
For example, with 192.168.1.130/26, the last mask octet is 192, so the block size is 256 - 192 = 64. The blocks start at 0, 64, 128, and 192; 130 falls in the block that starts at 128.
So the network address is 192.168.1.128, the broadcast address is 192.168.1.191, and the host range is 192.168.1.129–192.168.1.190 (62 hosts). Try entering it in this tool to check the result.
8How to choose the right CIDR for the number of devices you need
Add 2 to the number of hosts you need, then find the smallest power of 2 that can hold that total. That gives you the subnet size.
For example, for 100 devices, 100 + 2 = 102, and the smallest power of 2 that can hold 102 is 128, so you need /25. For 50 devices, 52 → 64, so /26; for 300 devices, 302 → 512, so /23.
Enter a number in the required host count field below the tool, and it will calculate this automatically.
Leave room for growth. Cloud providers may reserve several addresses in each subnet (AWS, for example, reserves 5), so check the service documentation for the actual usable count.
9How to check whether two addresses are on the same network
Apply the same mask to both addresses. If their network addresses match, they are on the same subnet; otherwise, traffic must go through a router.
For example, 192.168.1.20/25 and 192.168.1.200/25 both start with 192.168.1, but they are on different subnets. A /25 splits the range into 0–127 and 128–255: 20 is in the first block, while 200 is in the second.
If devices on the same router cannot communicate, use this tool to check each one and see whether one has a different subnet mask.
10What to do when a subnet mask is reported as invalid
A subnet mask must consist of 1s followed by 0s. If 0s and 1s are mixed in the middle, the mask is invalid.
Each octet in a mask must be one of the nine values below. Also, once an octet is not 255, every octet after it must be 0.
255
Binary
11111111
Number of 1 bits
8
254
Binary
11111110
Number of 1 bits
7
252
Binary
11111100
Number of 1 bits
6
248
Binary
11111000
Number of 1 bits
5
240
Binary
11110000
Number of 1 bits
4
224
Binary
11100000
Number of 1 bits
3
192
Binary
11000000
Number of 1 bits
2
128
Binary
10000000
Number of 1 bits
1
0
Binary
00000000
Number of 1 bits
0
Octet value
Binary
Number of 1 bits
255
11111111
8
254
11111110
7
252
11111100
6
248
11111000
5
240
11110000
4
224
11100000
3
192
11000000
2
128
10000000
1
0
00000000
0
For example, 255.0.255.0 and 255.255.255.100 are not valid subnet masks.
11How to split a large network into smaller subnets
Enter a new prefix length that is longer than the current one to divide the network evenly into subnets of the same size. The number of subnets is 2 to the power of (new prefix length - current prefix length).
For example, splitting 10.0.0.0/24 into /26 creates 2² = 4 subnets, starting at 10.0.0.0, 10.0.0.64, 10.0.0.128, and 10.0.0.192. Each subnet supports 62 hosts.
If different departments need different numbers of devices, use variable-length subnet masking (VLSM) and allocate the largest subnets first. Calculate each size separately with this tool. When there are many results, only the first ones are displayed; you can save the table as CSV.
12Why are /31 and /32 calculated differently?
/31 is used for a direct link between two devices, while /32 represents a single address. The usual host-count formula (total addresses - 2) does not apply to either in the same way.
Under RFC 3021, both addresses in a /31 can be assigned to devices, so there is no broadcast address. This tool also omits the broadcast address for /31 and longer prefixes. A /32 is used for a route to a specific device or for a loopback address.
13What happens when you convert an IP address to an integer or hexadecimal?
An IPv4 address is really a single 32-bit number. The four numbers separated by dots are simply a more readable way to show it in 8-bit chunks.
For example, 192.168.1.1 is 192×16,777,216 + 168×65,536 + 1×256 + 1 = 3,232,235,777, or C0A80101 in hexadecimal. Storing IP addresses as numbers in a database makes range searches easier.
You can see the value of an entered IP address in the tool's integer and hexadecimal fields. This tool calculates IPv4 only; IPv6 is not supported.
14What is a wildcard mask?
A wildcard mask is the inverse of a subnet mask: its 0s and 1s are flipped. It is used in router access control lists and some routing configurations.
For example, the wildcard mask for 255.255.255.0 is 0.0.0.255, and for 255.255.255.192 it is 0.0.0.63. Subtract each octet from 255 to calculate it. The subnet mask and wildcard mask always add up to 255.255.255.255.
The results table in this tool includes the wildcard mask, so you can copy it straight into your device configuration. Mask handling varies by manufacturer, so check the examples in your device documentation.
15Common mistakes when configuring a router or office network
Most problems are not caused by the calculations themselves, but by overlapping address ranges or inconsistent subnet masks.
A common issue is when a home network and a work VPN both use 192.168.0.0/24, preventing them from communicating. Change one of the ranges to avoid the overlap.
If the gateway address is outside the subnet, devices will not be able to reach external networks.
Assigning the network address or broadcast address directly to a device can cause problems.
If a subnet in the cloud is too small, it can be difficult to expand later.
If devices on the same floor or in the same department use different subnet masks, only some devices may lose connectivity, making the cause difficult to find.
It's also common to change the mask to /24 without updating the DHCP lease range.
When choosing a new range, use this tool to compare the first and last host addresses in each range and make sure it does not overlap with existing office, VPN, or cloud networks. Even a small overlap can cause routing problems.