Subnet Calculator
Network, broadcast, host range and mask for any IPv4 block as you type, in binary too, with a cheat sheet.
- Free, no signup
- Calculated in your browser
- Updated November 12, 2026
192.168.1.0/24 · 254 usable addresses
In binary
network bits host bits
Split into smaller subnets
| Subnet | Usable hosts | Broadcast |
|---|---|---|
IPv4 subnet cheat sheet
Every prefix from /8 to /32: its mask, how many addresses it holds, and how many hosts can use them.
| Prefix | Subnet mask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /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 |
Usable hosts leave out the network and broadcast addresses; a /31 (point-to-point links, RFC 3021) uses both, a /32 is one address.
IP risk check
Is an IP address safe?
Any IP checked against VPN, proxy, Tor and datacenter ranges and public blocklists: a 0–100 risk score with every reason shown. Free, no signup.
This IP subnet calculator takes an IPv4 address with a prefix (192.168.1.10/24) or a mask (192.168.1.10 255.255.255.0). It shows the network and broadcast addresses, the usable host range, the subnet mask and wildcard mask, and how many hosts fit: a /24 holds 254. It also marks the network bits in binary and splits the block into smaller subnets.
A subnet is a block of consecutive IP addresses that share the same network bits, so the devices in it reach each other directly and send everything else through a router. The cheat sheet above lists every prefix from /8 to /32; the calculator works with IPv4 only.
Worked example: 10.20.30.77/27, step by step
This is what the calculator does when you type an address with its prefix, worked by hand for 10.20.30.77/27:
- Host bits: 32 − 27 = 5, so the block holds 25 = 32 addresses.
- Subnet mask: 27 ones fill three octets and 3 bits of the fourth: 256 − 32 = 224, so
255.255.255.224. The wildcard mask is the inverse,0.0.0.31. - Network address: blocks of 32 in the last octet start at 0, 32, 64, 96… 77 falls in the block that starts at 64, so the network is
10.20.30.64. - Broadcast address: the last address of the block, 64 + 31 =
10.20.30.95. - Usable range: everything between them,
10.20.30.65to10.20.30.94: 30 hosts.
The same five steps give the subnet range for any IPv4 address, once you know its prefix. In a Cisco access list the block is written with its wildcard mask: permit 10.20.30.64 0.0.0.31.
How to calculate a subnet mask from CIDR
The prefix length is the number of 1 bits at the start of the 32-bit mask. A /26 is 26 ones followed by 6 zeros:
11111111.11111111.11111111.11000000
255. 255. 255. 192 = 255.255.255.192
Shortcut: in the octet where the ones stop, the value is 256 minus the block size within that octet. A /26 has blocks of 64, so 256 − 64 = 192; for a /22 the third octet steps by 4, so it is 256 − 4 = 252. CIDR (RFC 4632) replaced the old class A, B and C sizes with prefixes of any length.
How many hosts are in a /24, /25, /26 and smaller?
| Prefix | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /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 |
| /31 | 255.255.255.254 | 2 | 2 (point-to-point, RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 (a single host) |
The formula is 2(32 − prefix) addresses, minus 2 for the network and broadcast addresses. RFC 3021 lets a /31 use both of its addresses on a point-to-point link. For every prefix from /0 to /32 with the private and special ranges, see the full subnet cheat sheet.
Which subnet size do you need?
For a number of hosts: pick the longest prefix whose usable count is at least that number. 50 devices fit a /26 (62), 100 a /25 (126), 200 a /24 (254), 500 a /23 (510) and 1,000 a /22 (1,022).
For a number of subnets: borrow host bits. Each borrowed bit doubles the subnets and halves their size. To cut 192.168.10.0/24 into 6 subnets, borrow 3 bits (23 = 8, the smallest power of two that is at least 6). That gives eight /27s at .0, .32, .64, .96, .128, .160, .192 and .224, each with 30 usable hosts. Pick /27 in “Split into smaller subnets” above and the tool lists them.
Cloud networks take a few addresses more: AWS reserves 5 in every subnet (the first four and the last), so a /24 there leaves 251. Private ranges such as 10.0.0.0/8 come from RFC 1918.
How to find your subnet mask
A website cannot see your subnet mask: it belongs to your local network, and browsers do not expose it. Your device shows it:
- Windows: run
ipconfigin Command Prompt and look for “Subnet Mask” under your active adapter. - macOS: System Settings, Network, your connection, Details, TCP/IP. Or in Terminal:
ipconfig getoption en0 subnet_mask(en0 is usually Wi-Fi). - Linux:
ip -4 addr showprints the address with its prefix, for exampleinet 192.168.1.10/24; paste that straight into the calculator. - iPhone and Android: on an iPhone, open Settings, Wi-Fi and tap the (i) next to your network: it lists “Subnet Mask”. On Android, open the Wi-Fi settings and tap your network; versions vary, and some show the prefix length instead.
On most home networks the answer is 255.255.255.0, a /24. The address websites see is a different one, your public IP, which the IP lookup shows.
Key subnet terms
- Network address: the first address, naming the subnet itself. Not assigned to a host.
- Broadcast address: the last address, which reaches every host on the subnet.
- Subnet mask: the 32-bit value that marks which bits are network and which are host. See the subnet mask glossary entry.
- Wildcard mask: the mask inverted (0.0.0.255 for a /24), used in Cisco ACLs and OSPF statements.
VLSM and supernetting
Variable length subnet masking (VLSM) means using different prefix lengths inside one block: /30s or /31s for router links, /24s for user LANs, a /27 for a server room. Allocate the largest subnets first, each on a boundary that is a multiple of its own size, and the pieces never overlap. The split view lists the valid boundaries for subnets up to 12 bits smaller than the block.
Supernetting goes the other way: four contiguous /24s, 10.0.0.0/24 to 10.0.3.0/24, can be announced as one 10.0.0.0/22, which keeps routing tables small. To turn an arbitrary range into the fewest CIDR blocks, use IP range to CIDR; to list the addresses in a block, CIDR to IP range.
Frequently Asked Questions
How many hosts are in a /24?
254 usable hosts. A /24 holds 256 addresses; the first is the network address and the last the broadcast address. A /25 has 126 usable, a /26 62, a /27 30, a /28 14, a /29 6 and a /30 2.
What is the subnet mask for /24?
255.255.255.0. The first 24 bits are ones, which fills the first three octets with 255. A /26 is 255.255.255.192 and a /22 is 255.255.252.0. Going the other way, a /16 is 255.255.0.0 and a /8 is 255.0.0.0, the old class B and class A sizes.
How do I find the IP range of a subnet?
Find the network address (the block the address falls in), then add the block size minus one for the broadcast address; the usable range sits between them. For 10.20.30.77/27 that is 10.20.30.65 to 10.20.30.94. Type the address with its prefix into the calculator, or list every address of a block with CIDR to IP range.
What’s my subnet mask?
Most home networks use 255.255.255.0. To be sure, run ipconfig on Windows or open your Wi-Fi details (steps above); no website can read it for you.
How do I calculate a subnet mask from an IP address?
You can’t from the address alone: the mask is set by the network, not encoded in the IP. Get the prefix from your device or provider, then write that many 1 bits followed by 0 bits and convert each octet to decimal. The calculator does this when you type the address with its prefix.
What is the difference between CIDR and a subnet mask?
They say the same thing in two notations. CIDR writes the number of network bits after a slash (/24); a subnet mask writes the same bits as four decimal octets (255.255.255.0). The calculator accepts either; the CIDR notation glossary entry has more examples.
Why are 2 addresses not usable in a subnet?
The first address identifies the network and the last is the broadcast address, so neither can be given to a device. The exceptions are /31 point-to-point links (RFC 3021), which use both, and /32, a single host. That is why a /24 has 256 addresses but only 254 usable hosts.
What is the difference between a subnet mask and a default gateway?
The mask tells your device which addresses are on its own network; the gateway is the router address it sends everything else to. Both appear together in ipconfig and in your Wi-Fi details. On a home network the gateway is usually the router at .1, for example 192.168.1.1 inside 192.168.1.0/24.
Does this subnet calculator work with IPv6?
No, it handles IPv4 only. IPv6 subnetting is simpler in practice: a LAN is almost always a /64, because RFC 4291 gives most unicast addresses a 64-bit interface identifier. To write an IPv6 address in full or in short form, use the IPv6 expander and compressor.
Related Tools
CIDR to IP Range Converter
Convert CIDR notation to IP address ranges — see first IP, last IP, subnet mask, and total hosts. Useful for firewall rule planning.
Open toolIP Address Converter
Convert IP addresses between decimal, binary, hexadecimal, and octal formats.
Open toolIP Range to CIDR Converter
Convert an IP address range to the smallest set of CIDR blocks that cover it exactly.
Open tool