Free IP Subnet Calculator Online
Calculate subnet masks, network addresses, broadcast addresses, and available hosts.
Ad space
Ad space
How to use the IP Subnet Calculator
- 1
Open the IP Subnet Calculator tool
- 2
Enter your data or upload your file
- 3
Adjust settings if needed
- 4
Get instant results
- 5
Download or copy your output
Frequently asked questions
Is the IP Subnet Calculator free?
Yes, our ip subnet calculator is 100% free with no limits, no signup, and no watermarks.
Do I need to create an account?
No. You can use the ip subnet calculator without any registration. Just open it and start using it.
Is my data safe?
Yes. Any files you upload are automatically deleted after 5 minutes. We never store, share, or access your data.
Does this work on mobile?
Yes. The ip subnet calculator is fully responsive and works on phones, tablets, and desktops.
Is there an API for this?
Yes. All our tools are available as API endpoints for developers. Check our API documentation for details.
IP Subnet Calculator: Work Out Network, Broadcast, and Usable Hosts from a CIDR Block
An IP subnet calculator takes an IPv4 address plus a prefix length or subnet mask and works out every number that address range implies: the network address, the broadcast address, the first and last assignable host, how many hosts are actually usable, the wildcard mask, and the subnet mask itself written back out in dotted-quad form. Type 192.168.1.0/24 into the box and the tool immediately reports a network address of 192.168.1.0, a broadcast address of 192.168.1.255, a usable host range running from 192.168.1.1 to 192.168.1.254, and a usable host count of 254 out of 256 total addresses in the block. That single example covers the most common home-router and small-office subnet size, and the same bit-level arithmetic scales to any prefix from /0 to /32.
The math behind subnetting is just binary AND and OR operations against a 32-bit number, but doing it by hand — converting each octet to binary, aligning the mask, carrying the bits — is slow and easy to get wrong, especially at prefixes that don't land on an octet boundary like /27 or /29. This calculator runs that arithmetic directly in your browser the instant you type a value, so there is no upload, no server round trip, and no waiting: the network address, broadcast, host range, and mask fields all update together as soon as the input parses as a valid IPv4 address and prefix.
How to Use the Subnet Calculator
- Choose an input mode at the top of the tool: CIDR for a single combined field like 10.0.0.0/16, or IP + Mask if you have the address and the dotted-quad mask (like 255.255.0.0) as two separate values instead.
- In CIDR mode, type the address and prefix separated by a slash. The prefix must be a whole number from 0 to 32; anything outside that range, or a slash-less input, produces an inline error rather than a guessed result.
- In IP + Mask mode, enter the address in one field and the subnet mask in the other. The mask is validated as a contiguous run of 1-bits followed by 0-bits — a discontiguous pattern like 255.0.255.0 is rejected outright, since it isn't a legal subnet mask no router would accept it either.
- Once both values parse, a results panel lists network address, broadcast address, first host, last host, usable host count, total address count, the subnet mask, the wildcard mask, the CIDR form, and the classful IP class of the starting address.
- Click any value in the results panel to copy just that string to your clipboard — useful when you need to paste the broadcast address into a firewall rule or the wildcard mask into a router access list without retyping it.
- For a /31 or /32 prefix, a short note appears under the results explaining the edge-case behavior for that specific block, since the usual "subtract two for network and broadcast" rule doesn't apply cleanly at those two prefix lengths.
Because every step of this happens as plain arithmetic on a 32-bit integer, there is nothing to send anywhere: the address you type never leaves the tab, and switching between CIDR and IP+Mask input recalculates instantly rather than triggering a fresh request.
Why People Reach for a Subnet Calculator
- Designing a home or small-office network. Deciding how many devices a router's DHCP range needs to cover, and picking a prefix that leaves room to grow, is far easier when you can see the exact usable host count for /22 through /30 side by side instead of recomputing powers of two by hand.
- Carving a larger block into smaller subnets. Splitting a /16 office allocation into per-floor or per-department /24s means repeatedly checking that each new block's network and broadcast addresses land where you expect and don't overlap the next one.
- Writing firewall and router ACL rules. Many router and firewall configuration languages, Cisco access control lists among them, expect a wildcard mask (the inverse of a subnet mask) rather than the subnet mask itself, and getting that inversion wrong silently matches the wrong set of addresses.
- Studying for a networking certification. CCNA-style exams lean heavily on fast, accurate subnetting under time pressure; running through practice CIDR blocks against a calculator is a quick way to check your own by-hand math before you trust it.
- Sizing cloud VPC and subnet allocations. Cloud providers ask for a CIDR block when you create a virtual network, and a couple of the smallest usable addresses in every subnet are typically reserved by the platform itself, on top of the standard network and broadcast addresses this tool already accounts for.
What Each Result Field Represents
| Field | What it means | Example (192.168.1.0/24) |
|---|---|---|
| Network address | The address with every host bit set to zero — identifies the subnet itself, never assigned to a device | 192.168.1.0 |
| Broadcast address | The address with every host bit set to one — used to reach every device on the subnet at once, never assigned to a single device | 192.168.1.255 |
| First / last host | The lowest and highest addresses between network and broadcast — the actual assignable range | 192.168.1.1 – 192.168.1.254 |
| Usable hosts | Total addresses in the block minus the network and broadcast addresses (with /31 and /32 handled as special cases below) | 254 |
| Total hosts | Every address in the block, including network and broadcast: 2 raised to the number of host bits | 256 |
| Subnet mask | The prefix length written out as a dotted-quad number, with the network bits set to 1 | 255.255.255.0 |
| Wildcard mask | The bitwise inverse of the subnet mask, used by ACL syntax that matches on "don't care" bits rather than network bits | 0.0.0.255 |
| IP class | The historical classful category (A, B, C, D for multicast, E reserved) based on the address's leading bits — informational only, since classless addressing replaced fixed class boundaries decades ago | C |
The /31 and /32 Edge Cases
The "usable hosts equals total addresses minus two" rule that works for every prefix from /0 through /30 breaks down at the two smallest blocks, and getting these two prefixes wrong is one of the more common subnetting mix-ups. A /32 covers exactly one address with no room for a separate network or broadcast address at all — network, broadcast, and the single host are all the identical address, and the calculator reports one usable host rather than the negative number a naive subtraction would produce. A /31 covers exactly two addresses, and by the classic host-counting convention neither one is usable as a normal host address, since both would ordinarily be consumed as network and broadcast — the calculator reports zero usable hosts under that convention while still showing both addresses in the first-host and last-host fields. In practice, RFC 3021 specifically permits treating both addresses of a /31 as a point-to-point link between two routers, since a link with exactly two endpoints has no real use for a broadcast address anyway; this tool surfaces that nuance as an explanatory note rather than silently picking one interpretation and hiding the other.
Mistakes Worth Double-Checking
A wildcard mask is not the same thing as a subnet mask, and confusing the two is probably the single most common subnetting error in ACL configuration: a subnet mask has 1s over the network portion and 0s over the host portion, while a wildcard mask flips that pattern, and pasting one where the syntax expects the other silently matches a completely different, usually much larger, set of addresses without throwing any error. A discontiguous mask — something like 255.0.255.0 instead of a clean run of 1-bits followed by 0-bits — isn't a real subnet mask at all, even though it's easy to type by accident, and this tool rejects it rather than producing a network address that no real router would honor. It's also worth remembering that the classful "IP class" letter reported alongside the results is purely historical and carries no operational meaning under modern classless (CIDR) addressing — a /24 block starting with 10.x.x.x is still labeled class A by that old convention even though it's used and routed exactly like any other /24 today.
Doing the Math by Hand vs. Using This Calculator
- Manual binary conversion. Converting each octet of the address and mask to binary, lining them up, and applying AND/OR bit by bit is the textbook method taught in networking courses — it builds real understanding of how subnetting works, but it's slow and, at odd prefix lengths that split a byte in the middle, easy to mis-align by one bit.
- Router and switch built-in commands. Cisco IOS and similar platforms can show subnet information for an interface once it's already configured, which is useful for confirming a live device's settings but doesn't help you plan a new allocation before anything is deployed.
- Spreadsheet formulas. Bitwise functions exist in most spreadsheet software, and a formula-driven sheet scales well if you're generating dozens of subnet allocations at once for a documentation table, at the cost of setup time for a single quick check.
- This calculator's API. Provisioning scripts, network documentation generators, and infrastructure-as-code pipelines that need CIDR math outside a browser can call the same network/broadcast/host-range routine through this site's metered API: send a CIDR block or an IP-and-mask pair and get the full field set back as JSON instead of a rendered page. Request format, parameters, and current credit pricing are listed on the API documentation page.
Does this subnet calculator support IPv6?
No — this tool works with IPv4 addresses and prefixes only, from /0 through /32. An address that doesn't parse as a valid dotted-quad IPv4 value, including any IPv6 address, is rejected with an inline error rather than producing an incorrect result.
Why does the calculator show 254 usable hosts for a /24 instead of 256?
A /24 block contains 256 total addresses, but two of them are reserved by convention rather than assignable to a device: the lowest address in the block is the network address, and the highest is the broadcast address. Subtracting those two leaves 254 addresses that can actually be assigned to hosts — this applies to every prefix from /0 through /30, with /31 and /32 handled as separate edge cases.
What's the difference between a subnet mask and a wildcard mask?
A subnet mask marks the network portion of an address with 1-bits and the host portion with 0-bits — 255.255.255.0 for a /24. A wildcard mask is the exact bitwise inverse of that same mask — 0.0.0.255 for the same /24 — and is the form that access control list syntax on platforms like Cisco IOS expects instead of a plain subnet mask.
Can I enter a subnet mask instead of a CIDR prefix?
Yes. Switching to the IP + Mask input mode lets you type the address and the dotted-quad mask as two separate fields; the tool converts the mask to its equivalent CIDR prefix internally and reports the same full result set either way, since a subnet mask and a CIDR prefix length are two notations for the same information.
Related Network Tools
Once you've worked out a subnet's address range, a few related tools cover the rest of a typical networking task. Use the DNS lookup tool to check what a domain actually resolves to before you route traffic toward it, or the what is my IP tool to see the public address your own connection is using right now. If you're documenting a device's reported browser and platform details alongside its network configuration, the user agent parser breaks that information down field by field.
Ad space
Related tools
Ad space