About IP Subnet Calculator
Subnetting is one of those tasks where a single wrong bit means a device cannot reach the network. This calculator does the binary arithmetic for you. Type an IPv4 address with its prefix length in CIDR notation, for example 192.168.1.0/24 or 172.16.5.70/26, press Calculate, and it returns six facts: the network address, the broadcast address, the subnet mask in dotted form, the total number of addresses in the block, the number of usable host addresses and the first-to-last usable range.
It is built for network administrators planning address blocks, students preparing for CCNA or Network+ exams, developers configuring cloud VPCs and firewall rules, and home users setting up a router or a small office LAN. You do not need to enter the network address itself: any address inside the subnet works, and the tool finds the block it belongs to. Results are labelled in standard English networking terms, the same words you will see in router interfaces and documentation.
Why use it
- Returns network, broadcast, netmask, total and usable host counts and the host range from one line of input.
- Accepts any address inside the subnet, not just the network address, and works out the block for you.
- Converts the CIDR prefix to a dotted-decimal mask, such as /26 to 255.255.255.192.
- Uses standard networking labels, so results match what routers and cloud consoles show.
- Calculates instantly in your browser; nothing about your network is sent anywhere.
How to use
Type the address and prefix
Enter an IPv4 address followed by a slash and the prefix length, with no spaces in between, for example 10.20.0.0/22.
Press Calculate
The tool applies the mask to the address with bitwise arithmetic.
Read the six results
Network and Broadcast mark the start and end of the block. Netmask is the dotted mask. Total Hosts counts every address, Usable Hosts subtracts the network and broadcast addresses, and Range lists the first and last assignable addresses.
Examples
A typical home or office LAN
192.168.1.0/24 gives network 192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0, 256 total and 254 usable hosts, range 192.168.1.1 to 192.168.1.254.
Finding the block for a single device
A server has 172.16.5.70/26. The calculator shows it belongs to 172.16.5.64 to 172.16.5.127, mask 255.255.255.192, with 62 usable addresses from .65 to .126.
A point-to-point router link
192.168.10.130/30 is a block of 4 addresses: network .128, broadcast .131 and exactly 2 usable hosts, .129 and .130, one for each end of the link.
Sizing a cloud subnet
10.20.0.0/22 spans 10.20.0.0 to 10.20.3.255 with 1,024 total and 1,022 usable addresses under the classic rule, enough for a mid-sized application tier.
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /24 | 255.255.255.0 | 256 | 254 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /30 | 255.255.255.252 | 4 | 2 |
Tips
- Each step down in prefix doubles the block size: a /23 has twice the addresses of a /24.
- Cloud providers often reserve a few extra addresses in every subnet, so plan for slightly fewer usable hosts than the classic count.
- The tool works with IPv4 and accepts either CIDR notation such as /24 or a dotted mask such as 255.255.255.0 in the second field.
- For /31 and /32 prefixes, rely on the Total Hosts figure: /32 describes a single address and /31 is a special two-address point-to-point case.
- Keep a written plan of which subnets are in use so new blocks never overlap existing ones.
The calculation runs in your browser; the addresses you enter are not sent to any server.
Frequently asked questions
What input format does the calculator accept?
An IPv4 address in CIDR notation such as 192.168.1.10/24, or an IPv4 address plus a dotted subnet mask such as 255.255.255.0 in the second field.
What is CIDR notation?
CIDR writes a network as an address plus the number of leading bits that belong to the network part. /24 means the first 24 bits are the network and the last 8 bits identify hosts.
What is the network address?
It is the first address of the block, with all host bits set to zero. It identifies the subnet itself and is not normally assigned to a device.
What is the broadcast address?
It is the last address of the block, with all host bits set to one. Packets sent to it reach every device on the subnet.
Why is the usable host count two less than the total?
The network and broadcast addresses are reserved, so the classic rule subtracts two. A /24 has 256 addresses but 254 that can be given to devices.
Do I need to enter the network address?
No. Enter any address in the subnet, such as a device's own IP and prefix. The tool calculates which block that address belongs to.
How many hosts are in a /24, /25 or /26?
A /24 has 254 usable hosts, a /25 has 126 and a /26 has 62. Each extra prefix bit halves the size of the block.
Does the tool support IPv6?
No. It calculates IPv4 subnets only.
How do I convert a subnet mask to a prefix?
Count the one-bits in the mask. 255.255.255.0 has 24, so it is /24; 255.255.255.192 has 26, so it is /26. The table on this page lists common pairs.
What about /31 and /32?
A /32 represents one single address, often used for host routes and loopbacks. A /31 holds two addresses and is used on point-to-point links. For these, read the Total Hosts figure rather than the classic usable count.
Can I use this for cloud networks such as AWS or Azure?
Yes, the subnet maths is identical. Remember that cloud platforms reserve a few addresses in each subnet for their own services.
Is it suitable for exam practice?
Yes. Work out the answer on paper first, then use the calculator to check your network, broadcast and range.
Last updated: