Use this free subnet calculator to work out the network address, broadcast address, usable host range and subnet mask for any IPv4 address. Enter something like 192.168.1.1/24 and you get the usable hosts, wildcard mask, binary mask and the conventional default gateway — the one output most calculators leave out. Below the tool sits a full reference for every prefix from /8 to /32.
Quick Answer: What Is a Subnet Calculator?
A subnet calculator takes an IPv4 address and a prefix length such as 192.168.1.0/24 and computes the network address, broadcast address, usable host range, subnet mask and wildcard mask using a bitwise AND. A /24 gives 254 usable hosts, a /26 gives 62, and a /29 gives 6. Also called a subnet mask calculator, netmask calculator or IP subnet calculator — one job, several names.
Network Address
192.168.1.0
Broadcast Address
192.168.1.255
Subnet Mask
255.255.255.0
Prefix Length
/24
First Usable IP
192.168.1.1
Last Usable IP
192.168.1.254
Wildcard Mask
0.0.0.255
Usable Hosts
254
Total Addresses
256
Default Gateway (first usable, by convention)
192.168.1.1
or 192.168.1.254 if your convention uses the last
Where the boundary falls — 24 network bits / 8 host bits
Address 11000000.10101000.00000001.00000000 · Mask 11111111.11111111.11111111.00000000
Assignable addresses by cloud provider
AWS
251
reserves 5, min /28
Azure
251
reserves 5, min /29
Google Cloud
252
reserves 4, min /29
Checked against AWS, Microsoft and Google documentation in August 2026. "n/a" means the provider will not create a subnet of this size.
Pick a longer prefix to divide 192.168.1.0/24 into equal blocks.
VLSM planner — different sizes from one block
Enter the host counts each segment needs, separated by commas. Largest is allocated first, which is what keeps the blocks aligned.
Summary
The subnet 192.168.1.0/24 holds 256 addresses with 254 usable hosts, running 192.168.1.1 to 192.168.1.254. The subnet mask is 255.255.255.0 and the conventional default gateway is 192.168.1.1. This block sits in Private (RFC 1918) space. To write it as a range, or turn a range back into blocks, use our CIDR block converter.

OSINT & Network Utility Expert
I build and audit address plans for a living, and the mistake I see most is not bad maths — it is a host with the right IP, the right gateway and the wrong subnet mask. The link stays up, local devices answer, nothing external works. That is why this page shows the mask in binary and dotted form together, and why the gateway is labelled as a convention rather than a calculated value. Figures here were checked against vendor documentation in August 2026.
View All Articles by Robert HarrisonA subnet calculator takes an IPv4 address and a prefix length — 192.168.1.1 and /24, say — and works out everything a router, firewall or cloud console needs to know about that network. That means the network address, the broadcast address, the subnet mask, the first and last usable host, the total address count and the wildcard mask. The tool above returns all of it, plus the conventional default gateway, which most calculators leave out.
The same tool answers to several names. Subnet mask calculator, netmask calculator, IP subnet calculator, IP range calculator, IP address calculator and subnetting calculator all describe one job: turning an address plus a mask into a complete, usable address plan. Whichever term you searched for, this page does it, for every prefix from /1 to /32.
You will also see it written as one word — subnetmask — or shortened to submask in older documentation and exam material. Those refer to the same 32-bit value. Everything here runs online in the browser with no account and nothing to install, so calculating a netmask takes about as long as typing the address.
How the maths runs: every value is computed server-side with 32-bit integer bitwise operations, so there is no browser rounding involved. A /8 holds 16,777,216 addresses and that figure comes back exact rather than approximated.
Most subnet mask calculations start from the same place, and it is worth being clear about what you need before you begin. Calculating a netmask from an address alone is not possible. You need one more piece of information: either the prefix length, or the number of hosts the subnet has to hold. Give it either and the mask follows in one step — write that many 1 bits, pad the rest with zeros, and read the result back in dotted decimal.
Working from a host count instead, round up to the next power of two, remembering that two addresses are lost to the network and broadcast. Sixty devices needs 62 usable, which needs 64 total, which is 2⁶ — so 32 minus 6 gives you a /26, or 255.255.255.192.
Finding the network address from a host address is a single operation: line the address up against the mask in binary and keep a bit only where both are 1.
# Step 1 — the address in binary
192.168.1.55 = 11000000.10101000.00000001.00110111
# Step 2 — the /24 mask is 24 ones, then 8 zeros
/24 mask = 11111111.11111111.11111111.00000000
# Step 3 — AND them: keep a 1 only where both rows have 1
network = 11000000.10101000.00000001.00000000
= 192.168.1.0
# Step 4 — flip the mask and OR it for the broadcast
broadcast = 11000000.10101000.00000001.11111111
= 192.168.1.255
Those four steps are what runs when you press Calculate, which is why the tool still returns the right block when you type a host address rather than the network address. The AND always finds the true start. To watch the bits flip yourself, run the address through our IP to binary converter.
The shortcut worth memorising: subtract the interesting mask octet from 256 and you have the block size. 256 minus 192 is 64, so a 255.255.255.192 mask creates blocks of 64 starting at .0, .64, .128 and .192. That one trick replaces most of the binary work.
This is the lookup table rather than the calculator — useful when you already know the prefix and just want the mask, the host count, or where the next block starts. Every prefix from /8 to /32 is listed with its subnet mask, total addresses, usable hosts, and the step between consecutive blocks. The four rows people ask about most — /23, /25, /27 and /29 — are highlighted.
| Prefix | Subnet Mask | Total | Usable Hosts | Block Step | Typical Use |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | 1 (1st) | ISP / entire 10.x private space |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 | 128 (2nd) | Very large carrier block |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 | 64 (2nd) | Carrier NAT (RFC 6598) space |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 | 32 (2nd) | Large ISP allocation |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | 16 (2nd) | 172.16.x private space |
| /13 | 255.248.0.0 | 524,288 | 524,286 | 8 (2nd) | Regional carrier block |
| /14 | 255.252.0.0 | 262,144 | 262,142 | 4 (2nd) | Large enterprise WAN |
| /15 | 255.254.0.0 | 131,072 | 131,070 | 2 (2nd) | Multi-site enterprise |
| /16 | 255.255.0.0 | 65,536 | 65,534 | 1 (2nd) | Whole VPC or campus · 192.168.x space |
| /17 | 255.255.128.0 | 32,768 | 32,766 | 128 (3rd) | Half a /16 site |
| /18 | 255.255.192.0 | 16,384 | 16,382 | 64 (3rd) | Availability zone block |
| /19 | 255.255.224.0 | 8,192 | 8,190 | 32 (3rd) | Large data-centre tier |
| /20 | 255.255.240.0 | 4,096 | 4,094 | 16 (3rd) | Data-centre tier / AZ allocation |
| /21 | 255.255.248.0 | 2,048 | 2,046 | 8 (3rd) | Large Kubernetes node pool |
| /22 | 255.255.252.0 | 1,024 | 1,022 | 4 (3rd) | Kubernetes node pool · 4 combined /24s |
| /23 | 255.255.254.0 | 512 | 510 | 2 (3rd) | Double office LAN · 2 combined /24s |
| /24 | 255.255.255.0 | 256 | 254 | 1 (3rd) | Standard office LAN or cloud subnet |
| /25 | 255.255.255.128 | 128 | 126 | 128 (4th) | Half a /24 · department split |
| /26 | 255.255.255.192 | 64 | 62 | 64 (4th) | Database or app tier |
| /27 | 255.255.255.224 | 32 | 30 | 32 (4th) | Management or bastion subnet |
| /28 | 255.255.255.240 | 16 | 14 | 16 (4th) | Small DMZ · smallest AWS subnet |
| /29 | 255.255.255.248 | 8 | 6 | 8 (4th) | Small office block · smallest Azure/GCP subnet |
| /30 | 255.255.255.252 | 4 | 2 | 4 (4th) | Router-to-router link (legacy) |
| /31 | 255.255.255.254 | 2 | 2 | 2 (4th) | Point-to-point link (RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 | 1 (4th) | Single host · firewall rule |
The step tells you where the next block of the same size begins, and which octet moves. A /22 steps by 4 in the third octet, so valid blocks start at 10.0.0.0, 10.0.4.0, 10.0.8.0 and so on — 10.0.5.0/22 is not a legal block start, and most routers will quietly widen it to 10.0.4.0/22 rather than warning you.
Where other reference tables get this wrong: several widely used charts still list /31 and /32 as having zero usable hosts. That has not been true since RFC 3021, published by the IETF in December 2000, which allows both addresses in a /31 to be used on a point-to-point link. A /32 is a single host route and is used constantly in firewall rules and route tables. The table above reflects that.
These four come up more than any others, usually because someone has been handed one and needs to know what it holds. Each answer follows the same two-step read: subtract the prefix from 32 for the host bits, then raise 2 to that power for the block size.
A /29 is 255.255.255.248 — 8 total addresses, 6 usable hosts. Blocks step by 8 in the last octet, so they start at .0, .8, .16, .24 and so on. It is the smallest subnet Azure and Google Cloud will accept, and a common size for a small office allocation from an ISP. On Azure a /29 leaves only 3 assignable addresses, because the platform reserves five rather than two.
A /27 is 255.255.255.224 — 32 addresses, 30 usable hosts, stepping by 32. This is the workhorse size for management subnets, bastion hosts and small application tiers. It is also the size most often recommended for an Azure gateway subnet, where the documented /29 minimum leaves no headroom for a later SKU upgrade.
A /25 is 255.255.255.128 — 128 addresses, 126 usable hosts. It is exactly half a /24, so it splits an office LAN cleanly into two departments at .0 and .128. If you are asking how many usable IPs are in a /25, that is the number: 126, after the network and broadcast come off.
A /23 is 255.255.254.0 — 512 addresses, 510 usable hosts. It is two /24s joined, which makes it the usual answer when a single /24 runs out and renumbering is not an option. Blocks step by 2 in the third octet, so 10.0.0.0/23 and 10.0.2.0/23 are valid but 10.0.1.0/23 is not.
Reading any prefix in your head: 32 minus the prefix gives the host bits. Two to that power is the block size. Subtract two for the network and broadcast. A /26 leaves 6 host bits, 2⁶ is 64, minus 2 is 62 usable — done in about three seconds once the pattern sticks.
The prefix length is simply the count of 1 bits in the subnet mask. 255.255.255.0 is twenty-four 1 bits, so it is /24. Going the other way, write the prefix as that many 1 bits and pad with zeros. The two notations carry identical information — they are the same value written differently.
Knowing which one a system wants matters more than it should. Windows network settings and macOS both label the field prefix length, Linux tools accept either, and most router interfaces still ask for a dotted netmask. Converting between them by hand is where the mistakes creep in, especially for masks that do not end on an octet boundary.
A legal mask is an unbroken run of 1s followed by 0s, which leaves exactly nine possible values for the octet where the boundary falls. Everything else in the mask is 255 or 0. Learn these nine and you can convert any mask on sight — 255.0.255.0 looks plausible but is invalid, because the run of 1s is broken.
| Octet | Binary | 1 Bits | Example Mask | Prefix |
|---|---|---|---|---|
| 0 | 00000000 | 0 | 255.255.255.0 | /24 |
| 128 | 10000000 | 1 | 255.255.255.128 | /25 |
| 192 | 11000000 | 2 | 255.255.255.192 | /26 |
| 224 | 11100000 | 3 | 255.255.255.224 | /27 |
| 240 | 11110000 | 4 | 255.255.255.240 | /28 |
| 248 | 11111000 | 5 | 255.255.255.248 | /29 |
| 252 | 11111100 | 6 | 255.255.255.252 | /30 |
| 254 | 11111110 | 7 | 255.255.255.254 | /31 |
| 255 | 11111111 | 8 | 255.255.255.255 | /32 |
The same nine values apply in any octet. 255.255.254.0 puts the 254 in the third octet — seven 1 bits there on top of sixteen before it, so twenty-three in total, which is a /23. The full mask-to-prefix mapping for all 25 sizes is in the reference table above, and the tool returns both notations for whatever you enter.
Calculating the IP range and the host count is the same operation twice. Take the total address count and subtract two. The formula is 2^(32 − prefix) − 2, and the two you lose are the network address at the bottom and the broadcast address at the top. A /24 has 256 addresses and 254 usable hosts. A /26 has 64 and 62. A /29 has 8 and 6.
If you are sizing a subnet for AWS, Azure or Google Cloud, the textbook number will leave you short. Each platform reserves addresses for its own routing and DNS, and these figures are current as of August 2026:
| Platform | Reserved | Smallest Subnet | Usable in a /24 | Usable in a /28 |
|---|---|---|---|---|
| Standard networking | 2 | /32 host route | 254 | 14 |
| AWS | 5 | /28 | 251 | 11 |
| Azure | 5 | /29 | 251 | 11 |
| Google Cloud | 4 | /29 | 252 | 12 |
The gap widens as blocks get smaller. An AWS /28 looks like 14 addresses and delivers 11, and a single NAT gateway plus one interface endpoint takes two of those before a workload lands. Google Cloud is the only one of the three that lets you widen a subnet in place afterwards rather than rebuilding it.
Here is the honest answer nobody seems to give: the default gateway is not calculated. It is a choice. It is whichever address you assign to the router interface that carries traffic out of the subnet, and any usable address in the range will work. What exists is a strong convention, not a formula.
10.0.1.1 in a 10.0.1.0/24. This is what almost every home router, ISP and cloud platform uses, and it is what the tool above shows.10.0.1.254 in the same block. Common in enterprise networks that reserve the low end for infrastructure. The tool shows this too, so you have both.Two rules are genuinely fixed rather than conventional. The gateway must sit inside the same subnet as the hosts using it — a device on 10.0.1.0/24 cannot use 10.0.2.1 as its gateway, because it would have to route through the gateway to reach the gateway. And it can never be the network or broadcast address, which is why the calculator offers only usable addresses.
The mismatch that produces "no internet" with a working link: a host with a correct IP and gateway but the wrong subnet mask will decide the gateway is on a different network and stop sending traffic to it. The link stays up, local devices may still answer, and nothing external works. If that is the symptom, check the mask before anything else.
A website cannot read your subnet mask, and any tool claiming to show it is showing you something else. Your mask is local network information that never leaves your router — a web server sees only the public address your traffic arrives from. So this is a two-second check on your own machine rather than something a subnet calculator can answer.
# Windows — look for "Subnet Mask" under your active adapter
ipconfig
# macOS — the mask appears as a hex value like 0xffffff00
ifconfig | grep netmask
# Linux — the /nn after the address is your prefix length
ip addr show
# Any platform, no terminal: router admin page,
# usually 192.168.0.1 or 192.168.1.1 -> Status or LAN settings
macOS reports the mask in hexadecimal. 0xffffff00 is 255.255.255.0 — each pair of hex digits is one octet, and ff is 255. Linux and the Windows 11 settings panel show a prefix length instead, so you will see /24 where you expected a dotted mask. Both mean the same thing, and the conversion table further up handles either direction.
Once you have your mask, paste it and your address into the calculator above to see the full block — the range your router is handing out, where the network address falls, and how many devices the subnet can actually hold before it runs out.
VLSM, or variable length subnet masking, means giving each subnet the size it actually needs instead of cutting everything to one mask. The older approach, FLSM, uses a single mask throughout — simpler to plan, and wasteful the moment your segments differ in size.
The difference shows up fast. Take a 192.168.1.0/24 that has to serve 100 workstations, 50 phones, 20 servers and three router links. Split it into four equal /26 blocks and the router links get 62 addresses each to use two, while the workstation segment runs out at 62 of the 100 it needs. Size each one instead and it fits comfortably:
# VLSM allocation — largest block first, always
192.168.1.0/25 workstations 126 usable (needs 100)
192.168.1.128/26 phones 62 usable (needs 50)
192.168.1.192/27 servers 30 usable (needs 20)
192.168.1.224/30 router link 1 2 usable
192.168.1.228/30 router link 2 2 usable
192.168.1.232/30 router link 3 2 usable
# 192.168.1.236 - .255 still free for growth
Allocating largest first is the part people skip, and it is what keeps the plan working. Start with the small blocks and the big one has nowhere aligned to land. Every subnet still has to begin on a boundary that matches its own size, which the reference table above gives you at a glance.
The reverse operation is supernetting — merging adjacent blocks into one larger route rather than splitting a block into smaller ones. It follows the same alignment rules read backwards, and our guide to route aggregation and CIDR blocks covers it properly, including turning a start-and-end range back into the blocks that cover it.
Three blocks are reserved for internal use and never routed on the public internet. Everything you subnet inside an office, a home network or a cloud environment should come from one of them, and picking the wrong one causes collisions later rather than errors now.
| Block | Range | Addresses | Best Used For |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 | 16,777,216 | Enterprises and cloud VPCs — room to give every site its own /16 |
| 172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 | 1,048,576 | Mid-size networks — but avoid 172.17.0.0/16, Docker claims it |
| 192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 | 65,536 | Homes and small offices — the default on nearly every router |
A single /24 out of 192.168.x.x is right for almost every household. It gives 254 usable addresses, which is far more than a home will ever hold, and it matches what your router ships with so nothing needs reconfiguring.
The one change worth making is moving off the factory default. Routers ship on 192.168.0.0/24 or 192.168.1.0/24, and so does everyone else's — which breaks VPN connections into a work network that happens to use the same block. Picking something like 192.168.87.0/24 costs nothing and removes the collision entirely. If you want separate segments for guests, IoT devices and trusted machines, two or three /26 blocks out of the same /24 keeps them apart without complicating the routing.
Understanding which addresses are yours to allocate starts with the difference between routable and non-routable space, covered in our guide to IP address classes and how the ranges are divided.
The wildcard mask — also called the inverse mask, and both names appear in Cisco documentation — is the subnet mask flipped: where the mask has a 1, the wildcard has a 0. A /24 mask of 255.255.255.0 becomes a wildcard of 0.0.0.255. The tool returns it alongside the mask because Cisco access lists and OSPF network statements take the wildcard form, not the mask, and you need it the moment you touch IOS.
Pasting a subnet mask where a wildcard belongs is one of the most common lab mistakes there is, and nothing warns you — both values are valid syntax, so the ACL loads and then matches an address set you never intended. The full ACL and OSPF configuration guide, with worked examples, lives on our CIDR and wildcard mask reference rather than being repeated here.
No — and saying so is better than returning a wrong figure. This tool is IPv4 only, covering every prefix from /1 to /32. IPv6 uses 128-bit addresses with prefixes running to /128, and the address counts stop fitting in the 32-bit integer maths the engine is built on.
Two IPv4 habits also have to be unlearned before IPv6 makes sense. There is no broadcast address, so the subtract-two rule simply does not apply — a /64 gives you every one of its addresses. And you rarely subnet below /64 at all, because doing so breaks stateless address autoconfiguration. A /64 is the standard LAN, a /56 a typical home allocation, and a /48 a business site.
For IPv6 work, our IPv6 address expansion tool handles compressed notation, and the beginner's guide to IPv6 addressing covers the model itself.
A subnet calculator takes an IPv4 address and a prefix length and returns the network address, broadcast address, subnet mask, wildcard mask, usable host range and total address count. It replaces manual binary work that is slow and easy to get wrong.
You need the prefix length or a host count as well — the address alone is not enough. Write the prefix as that many 1 bits and pad with zeros, so /26 becomes 255.255.255.192. From a host count, round up to the next power of two and remember two addresses are lost.
Six. A /29 holds 8 addresses and loses two to the network and broadcast. The mask is 255.255.255.248 and blocks step by 8. On Azure or Google Cloud a /29 gives only 3 or 4 assignable addresses, because those platforms reserve five and four respectively.
It is the mask for a /24. The first 24 bits identify the network and the last 8 identify hosts, giving 256 total addresses and 254 usable. It is the default on nearly every home router and the standard size for an office LAN or a cloud subnet.
Count the 1 bits. 255.255.255.0 is twenty-four, so /24. 255.255.254.0 is twenty-three. Only nine values are legal in the octet where the boundary falls — 0, 128, 192, 224, 240, 248, 252, 254 and 255 — so the conversion is a nine-row lookup rather than real arithmetic.
Run ipconfig on Windows, ifconfig on macOS or ip addr show on Linux, or open your router's status page. No website can read it — your mask is local network information that never reaches a web server, so any tool claiming to display it is showing something else.
It is a configuration choice, not a calculation. Convention puts it on the first usable address, so 10.0.1.1 in a 10.0.1.0/24, though some networks use the last instead. The only hard rules are that it must sit inside the same subnet as its hosts and can never be the network or broadcast address.
FLSM uses one mask for every subnet, creating equal blocks. VLSM sizes each subnet to what it actually needs, which wastes far fewer addresses. Allocate largest block first when planning VLSM, otherwise the bigger subnets have nowhere aligned to land.
The rest of the addressing toolkit, each answering one question properly.
CIDR Calculator
Blocks to ranges, and ranges back to blocks
IP to Binary Converter
Watch the mask boundary in the bits
IPv6 Expansion
Expand compressed IPv6 addresses
IP to Decimal
Integer form for scripts and databases
Random IP Generator
Test data inside any block
All Network Tools
The complete free toolkit
Enter an IPv4 address and a prefix to get the subnet mask, usable host range, broadcast address and conventional default gateway. Free, instant, no account needed.