Subnet calculator: network, mask and host range from any IPv4 CIDR
Type an IPv4 address with a prefix or a mask and read its network, broadcast, wildcard and usable hosts. Then cut the block into equal subnets.
Runs in your browser. What you type stays on this page.
Subnet calculator
Runs in your browser. What you type stays on this page.
What a subnet calculator works out
A prefix such as /24 says how many of the 32 bits of an IPv4 address belong to the network; the remaining bits number the hosts. Every value in the results comes from that split: the network address (all host bits at 0), the broadcast (all host bits at 1), the subnet mask, the wildcard mask that inverts it, and the range of addresses you can give to devices.
A /n block holds 2^(32 − n) addresses. On an ordinary subnet the network and broadcast addresses take two of them, so usable hosts = 2^(32 − n) − 2. Two prefixes work differently, and the tool follows the standards for both: a /31 is a point-to-point link where both addresses are usable and there is no broadcast (RFC 3021), and a /32 is a single host.
The tool opens on 192.168.1.10/24. Its network is 192.168.1.0, the broadcast 192.168.1.255, the mask 255.255.255.0 and the wildcard 0.0.0.255. Usable hosts run from 192.168.1.1 to 192.168.1.254, 254 of 256 addresses. The address is private (RFC 1918), class C in the old scheme, and its reverse DNS zone is 1.168.192.in-addr.arpa.
How to use it
- Type the address in IPv4 address or CIDR with its prefix (10.0.0.0/22) or its mask (10.0.0.1/255.255.0.0). A space works too: 10.0.0.1 255.0.0.0.
- Or type the address alone and choose the prefix in Mask, where each prefix from /0 to /32 sits beside its dotted mask. Picking a mask also rewrites the /prefix in the address field.
- Read the results as you type: network address, broadcast, first and last usable host, subnet mask, wildcard mask, total addresses and usable hosts.
- Use the copy button beside a value to paste it into a firewall rule, a router or a DNS record.
- To cut the block into equal parts, choose a longer prefix in Split into. Each option shows how many subnets it makes, and the list below gives every network with its usable range and broadcast.
- Press Example to go back to 192.168.1.10/24, or Clear to empty the address field.
How to read the results
Network address and Broadcast are the first and the last address of the block, and on an ordinary subnet neither goes to a device. First usable host and Last usable host bound the range you can assign. Network in CIDR is the block written the short way, ready to paste.
Wildcard mask is the subnet mask inverted: 0.0.0.255 for a /24, 0.0.15.255 for a /20. Cisco-style access lists and OSPF network statements are written with it, so copy this value when a rule asks for a wildcard rather than a mask.
Address in binary and Mask in binary put a | where the network bits end, the quickest way to see why 192.168.1.10/20 belongs to 192.168.0.0. Address type says whether the address is private, carrier-grade NAT, loopback, link-local, documentation, multicast, another special-use block or public. Class (legacy) is there for reference only: routing has ignored address classes since CIDR replaced them.
Reverse DNS zone gives the in-addr.arpa zone of a /8, /16 or /24 block, and the PTR name of a /32. A prefix that does not end on an octet boundary gets no zone name, and the tool says so: a /20 is served as 16 separate /24 zones, and a block smaller than a /24 is delegated the classless way (RFC 2317). To read the PTR record an address has today, run a reverse DNS lookup.
CIDR prefix, mask and hosts for the common sizes
/30 is 255.255.255.252: 4 addresses, 2 usable. /29 is 255.255.255.248: 8 and 6. /28 is 255.255.255.240: 16 and 14. /27 is 255.255.255.224: 32 and 30. /26 is 255.255.255.192: 64 and 62. /25 is 255.255.255.128: 128 and 126. /24 is 255.255.255.0: 256 and 254.
Wider blocks follow the same rule. /22 is 255.255.252.0 with 1,024 addresses and 1,022 hosts, /16 is 255.255.0.0 with 65,536 and 65,534, and /8 is 255.0.0.0 with 16,777,216 and 16,777,214. To turn a prefix into a mask by hand, write n ones followed by 32 − n zeros and read them in four groups of eight bits.
Splitting a network into equal subnets
Every bit you add to the prefix doubles the number of subnets and halves their size. With the example, choosing /26 in Split into cuts 192.168.1.0/24 into 4 subnets: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26, each with 62 usable hosts. The first runs from 192.168.1.1 to 192.168.1.62, with 192.168.1.63 as its broadcast.
The list goes up to 8 bits longer than the block, so at most 256 subnets, and every piece is the same size. Pieces of different sizes, say one /25 and two /26 from a /24, have to be planned by hand: place the largest piece first, then split what is left.
Mistakes the calculator catches
An octet with a leading zero, such as 192.168.010.1, is refused: some systems read 010 as octal (8) and others as ten, so the same text can point at two different addresses. Write 192.168.10.1.
A dotted mask must have all its 1 bits first. 255.255.240.0 is a valid /20, while 255.0.255.0 is refused because no prefix matches it. An octet above 255 or a prefix above /32 is flagged too.
Typing a host with its prefix, such as 192.168.1.10/24, is fine: the tool masks it and reports the network, 192.168.1.0/24. When you write a firewall rule or an allowlist, paste Network in CIDR, not the host address you typed.
Private ranges and allowlists
Home, office and server networks use the private blocks 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). 100.64.0.0/10 is carrier-grade NAT (RFC 6598): seeing it as a router’s WAN address means the provider puts you behind its own NAT, so that address cannot be reached from the internet as it is. Some VPN overlays also number their peers from this block.
Before you allowlist a range in a firewall, a VPN or a server, check Total addresses. A prefix one bit shorter than you meant opens twice the space: 10.0.0.0/22 is 1,024 addresses, 10.0.0.0/21 is 2,048.
Questions
What is a subnet mask and how do I find mine?
A 32-bit value whose 1 bits mark the network part of an address: 255.255.255.0, or /24, means the first 24 bits are the network. On Windows, ipconfig lists the mask beside each IPv4 address; on Linux, ip addr shows it as the /prefix after the address.
How do I find the network address from an IP and a mask?
Apply the mask bit by bit: where the mask has a 1 the address bit stays, where it has a 0 the bit becomes 0. 192.168.1.10 with 255.255.240.0 gives the network 192.168.0.0.
How many usable hosts does a /24 have?
254. A /24 has 256 addresses, and the first (network) and the last (broadcast) are not assigned to devices.
What is a wildcard mask?
The subnet mask inverted: where the mask has 1s the wildcard has 0s, so 255.255.255.0 becomes 0.0.0.255. Router access lists and OSPF use it.
How do I convert a CIDR prefix to a subnet mask?
Write n ones followed by 32 − n zeros and read them in four groups of eight bits. A /26 is 26 ones, which gives 255.255.255.192.
Why does a /31 show two usable hosts?
RFC 3021 lets a /31 serve a point-to-point link with no network or broadcast address, so both addresses are usable. A /32 is a single host.
Can I split a network into subnets of different sizes?
Not in this tool: Split into cuts a block into equal subnets, up to 256 of them. For mixed sizes, split once, then run each piece again.
Is the IP address I type sent to a server?
No. The calculation runs in your browser, and the address stays on your device.
Related tools
-
IPv6 subnet calculator
Expands and compresses an IPv6 address, shows the network range and how many /64s fit, and splits the prefix.
-
IP lookup
See an IP’s approximate location and provider and its proxy or VPN, hosting and mobile flags.
-
ASN lookup
Find the ASN, announced prefix and network of an IP, or the holder and announced ranges of an ASN.
-
SLA and uptime calculator
Turns an uptime percentage into the downtime it allows from a day to a year, or a measured outage into uptime.
PubWeb
The sites on those servers, in one panel
PubWeb is an ecosystem of tools for web publishers, made by publishers. Its panel measures every site with first-party analytics, keeps bot and proxy traffic out of the numbers, and alerts you when a site goes down or a domain nears expiry.