IP Subnet Calculator – calculate subnet masks online
The IP Subnet Calculator instantly calculates the subnet mask (including in binary), network and broadcast addresses, wildcard mask, and usable host range from a CIDR address such as 192.168.1.0/24. In “CIDR ↔ IP Range” mode, you can convert CIDR blocks to IP ranges and back, including for IPv6. Free, with no sign-up required—the calculation runs right in your browser.
Built by Jakub Martyniak
Planning your own network? Get full control over your IPs.
Results appear as you type—no need to submit. Without a “/prefix length”, we automatically assume /24.
Network address
Broadcast address
Subnet mask
Subnet mask (binary)
Wildcard mask
Prefix length
Usable host range
Usable hosts
Total addresses
Example result
What the Subnet Calculator calculates
You enter a CIDR address, and the calculator immediately shows the network and broadcast addresses, subnet and wildcard masks, and the number of usable hosts. The values below are an example; your result depends on your input.
Example · Input: 192.168.1.0/24
- Network address
- 192.168.1.0
- The first address in the network. It identifies the network itself and is not assigned to a device.
- Broadcast address
- 192.168.1.255
- The last address in the network. Packets sent to it reach every device on the subnet.
- Subnet mask
- 255.255.255.0/24
- The first 24 bits belong to the network; the rest are available for hosts.
- Wildcard mask
- 0.0.0.255
- The inverse subnet mask used by Cisco ACLs and OSPF.
- Usable hosts
- 254
- Usable host range: 192.168.1.1 to 192.168.1.254.
- Total addresses
- 256
- The network and broadcast addresses are excluded from this.
Why this tool
Subnet mask, host range and CIDR conversion at a glance
Key features of the calculator.
CIDR Input
Just enter an address like 192.168.1.0/24—no separate mask needed.
Network & broadcast address
Network and broadcast addresses are calculated automatically from the CIDR input.
Subnet mask in binary, too
Alongside dotted-decimal notation, the calculator shows the subnet mask bit by bit, making the calculation easier to follow.
Wildcard mask
The wildcard mask for Cisco ACLs and OSPF configurations is displayed alongside it.
Usable host addresses
See immediately how many host addresses are actually usable in the subnet.
No account required
Just enter a CIDR range and calculate—no sign-up required.
Runs only in the browser
The calculation runs locally in your browser; nothing is sent to a server when you calculate.
CIDR to IP range
See the first and last addresses and the number of addresses in a CIDR block at a glance.
IP range to CIDR
Calculate the smallest possible list of CIDR blocks from a start and end address, for example for firewall rules.
IPv4 and IPv6
The converter also handles 128-bit addresses and displays large address counts exactly.
Export as TXT or CSV
In conversion mode, download all addresses in a block or range as a list, up to 1.048.576 addresses.
Share the result via a link
Your input is included in the page URL, so you can easily share a calculation.
How it works
How the subnet calculator works
Get all subnet values from a CIDR address in just a few steps.
Step 1
Enter CIDR address
Enter an IPv4 address with a prefix length, e.g. 192.168.1.0/24. Without “/”, the calculator assumes /24.
Step 2
See results instantly
Results appear as you type, without submitting: network and broadcast addresses, subnet mask (including in binary), wildcard mask, prefix length, usable host range, and host count.
Step 3
Copy values
Copy the network address, broadcast address, subnet mask, wildcard mask, or host range using the copy button beside each field.
Step 4
Convert between CIDR and IP ranges
Switch to “CIDR ↔ IP Range” mode: convert a CIDR block to its first and last addresses, or an IP range to the smallest possible list of CIDR blocks, for IPv4 and IPv6.
Step 5
Export or share
In conversion mode, download all addresses as TXT or CSV (up to 1,048,576 addresses), or share the calculation using the page URL, which includes your input.
CIDR ↔ IP range
Convert CIDR to an IP range and back
Firewalls, allowlists, and provider portals may require either a CIDR block or a start-to-end range. This converter switches between the two for IPv4 and IPv6.
CIDR to IP range
The first address is the block's network address; the last is obtained by setting all host bits to 1.
- 192.168.0.0/16
- 192.168.0.0 - 192.168.255.255
- 65,536 addresses
- 10.0.0.0/8
- 10.0.0.0 - 10.255.255.255
- 16,777,216 addresses
- 203.0.113.64/26
- 203.0.113.64 - 203.0.113.127
- 64 addresses
- 2001:db8::/32
- 2001:db8:: - 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
- 2^96 addresses
IP range to CIDR
A range can only be written as a single block if it starts and ends at valid boundaries. Otherwise, multiple blocks are needed; the converter produces the smallest possible list.
10.0.0.5 - 10.0.0.20
- 10.0.0.5/32
- 10.0.0.6/31
- 10.0.0.8/29
- 10.0.0.16/30
- 10.0.0.20/32
Together, the five blocks cover exactly the 16 addresses from 10.0.0.5 to 10.0.0.20, no more and no less.
Calculate subnet mask
Subnet mask table and calculation steps
The table shows the subnet mask, wildcard mask and number of addresses for common prefix lengths. Below it, we work through a subnet calculation step by step.
| Prefix | Subnet mask | Wildcard mask | Total addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
For /31 and /32, the calculator counts every address as usable: /31 is for point-to-point links under RFC 3021, and /32 represents a single host address.
Step-by-step calculation for 192.168.1.130/26
- 1
Convert prefix length to subnet mask
/26 means the first 26 bits of the mask are set to 1 and the rest to 0. This gives the subnet mask 255.255.255.192, or 11111111.11111111.11111111.11000000 in binary.
- 2
Calculate the network address
The IP address and subnet mask are combined with a bitwise AND: 192.168.1.130 AND 255.255.255.192 gives the network address 192.168.1.128.
- 3
Calculate the broadcast address
All host bits are set to 1, so the network address OR the wildcard mask—192.168.1.128 OR 0.0.0.63—gives the broadcast address 192.168.1.191.
- 4
Count usable hosts
6 host bits give 2^6 = 64 addresses. Excluding the network and broadcast addresses leaves 62 usable hosts from 192.168.1.129 to 192.168.1.190.
Enter 192.168.1.130/26 in the calculator above to get exactly these values without calculating them by hand.
Explore more
Related network tools
Subnetting exercises
NewPractice subnetting with random exercises at three levels: determine the network address, broadcast address, host range and number of hosts, check your answers and view the solution step by step.
Built by Luca Stanek
OSI model
NewInteractively learn the 7 layers of the OSI model: click layers, assign terms such as switch, ARP, or port 443, and explore animated encapsulation, a quiz, and a cheat sheet for the IHK exam.
Built by Justin Schuessler
TCP/IP model
NewInteractively learn the 4 layers of the TCP/IP model (DoD model) according to RFC 1122, with OSI model mapping, animated encapsulation, a port quiz, and a cheat sheet.
Built by Justin Schuessler
What is my IP?
Display the public IP address, IPv4/IPv6 version, reverse DNS record, and approximate country.
Built by Jakub Martyniak
Port Checker
Check whether specific ports are open on an IP or hostname—select a protocol or game instead of scanning all ports at once.
Built by Sebastian Rademacher
Common Ports & firewall commands
NewEnter a port or service to learn what it does and copy ready-to-use firewall commands for ufw, iptables, nftables, firewalld and Windows. Includes the complete IANA port list and a port check.
Built by Justin Schuessler
FAQ
Frequently asked questions about the Subnet Calculator
Quick answers about subnet masks, CIDR notation, host ranges, and conversion to IP ranges.
In CIDR notation, the prefix length follows the slash: with /24, 24 bits belong to the network and 8 bits to the hosts, corresponding to subnet mask 255.255.255.0. For 192.168.1.0/24, the calculator shows network address 192.168.1.0, broadcast address 192.168.1.255, wildcard mask 0.0.0.255, and usable host range 192.168.1.1 to 192.168.1.254—that is 254 usable hosts out of 256 addresses.
The prefix length determines how many bits of the subnet mask are set to 1. For example, /26 gives 255.255.255.192. The network address is the result of a bitwise AND between the IP address and subnet mask; it is the first address in the subnet. To get the broadcast address, set all host bits to 1; it is the last address. The calculator does both as you type and also shows the subnet mask in binary. You can find the full calculation steps further up this page.
The first address identifies the network itself (network address), while the last is reserved for broadcast messages to all devices in the subnet (broadcast address). That is why a subnet normally has two fewer usable host addresses than total addresses. For /31 (point-to-point links under RFC 3021) and /32 (a single host address), these addresses are not reserved, so the calculator counts every address as usable.
The wildcard mask is the inverse of the subnet mask (e.g., 0.0.0.255 instead of 255.255.255.0). It is primarily used in Cisco ACLs (Access Control Lists) and OSPF configurations, where address ranges are defined using wildcard masks rather than subnet masks.
Without “/prefix length”, subnet mode assumes /24 and marks the prefix length as “assumed”. The input field does not accept a subnet mask in dotted-decimal notation; it expects CIDR notation with a prefix length from 0 to 32. Convert the mask first, for example 255.255.255.0 to /24. The subnet mask table on this page can help. In “CIDR ↔ IP Range” mode, however, an address without a prefix is treated as a single address.
In “CIDR ↔ IP Range” mode, the calculator shows the first and last address of a CIDR block and the number of addresses: 192.168.0.0/16 runs from 192.168.0.0 to 192.168.255.255 and contains 65,536 addresses. To convert the other way, enter a start and end address. A range fits into a single block only if it starts and ends on the right boundaries. Otherwise, the converter returns the smallest possible list of CIDR blocks: 10.0.0.5 to 10.0.0.20 produces five blocks that you can copy together.
Partly. “CIDR ↔ IP Range” mode works with 128-bit addresses and shows the exact address count, even for a /64 with 18,446,744,073,709,551,616 addresses. The start and end addresses must both be IPv6; mixing IPv6 and IPv4 is not supported. Subnet mode, with its subnet mask, broadcast address, and host range, is IPv4-only.
Yes. In “CIDR ↔ IP Range” mode, you can download all addresses as TXT (one address per line) or as CSV with a header row. The file is generated directly in your browser, just like the calculation itself: nothing is sent to a server when you calculate. Exports are limited to 1,048,576 addresses, the number in an IPv4 /12 block. An IPv6 /64 therefore cannot be listed; use its start and end addresses instead.
Any more questions?
Contact SupportFull control over your own network with a VPS
A ZAP-Hosting VPS gives you full control over your IP addresses and network configuration, without third-party restrictions.
No setup. No risk. Online in seconds.
Looking for more tools? View all network tools