IPv4 Subnet Calculator (Simple)
| IPv4 Address: | |
| Subnet Mask / CIDR: |
IPv4 Subnet Calculator (Advanced with Class)
| IPv4 Address: | |
| Subnet Mask / CIDR: | |
| Class: |
IPv6 Subnet Calculator
| IPv6 Address: | |
| Prefix Length: |
IP Subnet Calculator
The IP subnet calculator gives you instant subnet answers for both IPv4 and IPv6: whether you paste an address in CIDR form, enter a dotted mask, or load a network and ask for subdivisions, it will return the network address, usable host range, mask formats, total addresses and the binary bit map you need for router configs.
Network engineers, developers, and students all use it to turn mental subnet math into copy-and-paste configs, fast and without guesswork. This page is practical, not theoretical: the aim is immediate, actionable results with short, clear explanations so you understand what the calculator shows and why it matters.
How to use the IP Subnet Calculator
Start by typing or pasting the address in whatever notation is easiest for you. If you know the prefix length, use CIDR (/xx) because thatโs compact and unambiguous; if you only remember a dotted mask, enter that instead, and the calculator will translate it. Click calculate, and the primary outputs appear immediately: the network base, the broadcast (for IPv4), the first and last usable hosts, and the total address count.
If you need alternate formats for router commands, switch to the dotted-decimal or binary view and copy the exact string you need; the calculator purposely keeps formats side-by-side so you do not transcribe incorrectly into access-lists or interface configs.
When planning multiple subnets, switch to the VLSM or workspace mode. Rather than manually guessing block sizes, tell the wizard how many hosts you need for each subnet and whether you require room to grow; the tool will sort requirements by size, allocate contiguous blocks from your parent network, and show any leftover address space.
This is how you avoid wasting a /24 on a 20-host VLAN: the calculator automates the โlargest-firstโ allocation that network engineers do in their heads, but with precision and no arithmetic mistakes.
Errors are handled helpfully rather than cryptically. If you paste an invalid address or a mask that doesnโt match the prefix length, the tool highlights the offending field and gives a clear message, for example, โmask and prefix mismatchโ or โaddress is a broadcast; choose a host address.โ
If you enter a /31 or /32 where host counts differ, the calculator explains the special cases instead of silently returning confusing zero-host counts. These messages prevent the classic off-by-one mistakes that show up when people manually count hosts.
What the calculator gives you
The network address is the anchor of any subnet: itโs the lowest numerical address in the block, and routers use it to route a whole range of hosts as a single entity. Seeing the network address in both decimal and binary removes ambiguity, especially when youโre aggregating routes or writing route maps. The calculator prints both, so you can paste the format your device expects.
For IPv4, the broadcast address is explicit and useful: itโs the highest address in the subnet used for subnet-directed broadcasts. The calculator clearly labels broadcast, so it cannot be mistaken for a usable host. Because IPv6 does not use broadcast, the IPv6 output replaces that field with informational multicast notes and keeps the focus on prefixes and next-hop logic.
First and last usable host fields are shown because humans need to know which addresses are safe to assign to devices. Traditional IPv4 subnets exclude the network and broadcast addresses from host assignments, so usable hosts are always two fewer than the total addresses; the UI explains this and highlights exceptions like /31, where two-address subnets are valid for point-to-point links, and /3,2, which denotes a single host route, precisely what you want for loopbacks or host-specific firewall rules.
We also show total addresses versus usable hosts so you can quickly compare a block’s raw numeric capacity with what you may actually assign. For example, a /28 has 16 addresses but only 14 usable hosts under classic rules; the calculator emphasizes that difference. For IPv6, it clearly shows that the address space is intentionally vast, so planning priorities differ.
Mask representation matters when you move from planning to configuration. The tool displays the mask in slash (CIDR), dotted decimal, wildcard (for ACLs), and binary forms; this lets you copy the exact string required by different vendors and reduces transcription mistakes. Finally, the binary view or bit layout is included because once you see the mask as a contiguous run of ones followed by zeros, the arithmetic becomes obvious. Toggling the bits helps juniors see why /28 yields 14 hosts and why contiguous aggregation is possible for adjacent blocks.
Quick primer: IPv4 subnetting made human
Think of an IP address like a postal address. The network part is the street name, and the host part is the house number. The prefix length, the /n, tells you how many leading bits belong to the street and how many bits are left for house numbers. Longer prefixes mean fewer houses; shorter prefixes mean more houses. That simple mental model makes subnetting far less scary.
To make this concrete, try the address 192.168.10.57/28. When the calculator masks the address, it zeros out the host bits beyond the /28 boundary and returns 192.168.10.48 as the network because that is the lowest address whose high 28 bits match the prefix. The calculator then finds the broadcast by setting all host bits to one, giving 192.168.10.63.
The usable host range sits between these two extremes: 192.168.10.49 through 192.168.10.62. In plain arithmetic, a/28 leaves four host bits, which yields 16 addresses; subtract the network and broadcast, and leaves 14 usable hosts. The calculator performs these bitwise operations under the hood and shows the result in binary if you want to follow each bit flip.
IPv6 considerations
IPv6 uses the same network-versus-host idea but applies it at a scale where address scarcity is not the daily problem it once was. Instead of dotted masks, we talk about prefixes (for example,/64), and we almost always use /64 for LANs because many IPv6 features, SLAAC, neighbor discovery, and certain autoconfiguration assumptions, expect a 64-bit interface identifier. There is no broadcast in IPv6; multicast replaces that behavior, so the calculator does not show a โbroadcastโ field for IPv6 but instead highlights the prefix and any relevant multicast notes.
Because the IPv6 address space is enormous, the calculator treats subnetting differently in tone: it helps you pick sane delegation sizes. It prevents the over-enthusiastic slicing that used to be necessary under IPv4. Enter 2001:db8:85a3::8a2e:370:7334/64 and the tool will identify the /64 network prefix, show the network address expanded or compressed as you prefer, and explain the adequate host capacity, a number so large that planning focuses on delegation and policy rather than counting individual hosts.
VLSM and practical subnet planning
Variable Length Subnet Masking is the technique that keeps addressing efficient: instead of carving equal-sized chunks, you give each group the smallest block that comfortably fits its devices. Imagine you have a /24 and need subnets for groups of 100, 30, and 6 hosts. A naive split into three equal parts wastes space; a pragmatic approach is to allocate a /25 for the 100-host group because it supports up to 126 hosts, a /27 for the 30-host group because it supports 30 usable hosts under classic rules, and a /29 for the 6-host group, which gives 6 usable addresses.
The calculatorโs VLSM wizard automates this: you list required host counts, choose whether to reserve growth headroom, and the system sorts demands largest-first, assigns contiguous subnets and reports any leftover space or overlaps. Sorting largest-to-smallest matters because it minimizes fragmentation and ensures the biggest consumers get contiguous blocks first, preventing awkward leftover fragments that cannot be used for larger future needs.
Common tasks and real examples
When sizing a subnet for a small office of roughly 120 devices, the trade-offs are more practical than theoretical. You could give the office a whole /24 and never worry about running out of addresses, but that wastes 50% of the block if you only need 120 hosts; a /25, by contrast, provides up to 126 usable addresses under classic IPv4 rules and fits the requirement with a small safety margin.
The calculator makes this arithmetic trivial: feed it the parent block and try /25 and /24 side-by-side, youโll immediately see that /25 yields 126 usable hosts and /24 yields 254, and the tool will flag how much address space each option consumes. That instant comparison is valid during planning meetings when someone asks about โfuture growthโ; seeing the numbers next to one another helps you decide whether to reserve a contiguous extra block for expansion or accept the denser packing and plan for a later renumbering.
Supernetting or aggregating contiguous networks is a common task when you want to simplify routing and shrink your routing table. Suppose you run four adjacent /24 networks and are tired of advertising four routes. In that case, the calculator shows how those four can be represented as a single /22 and exactly which /24 combinations are aggregatable without losing precision. It also points out when networks are not contiguous and therefore cannot be safely supernetted. That capability matters because route aggregation reduces churn and memory usage on edge routers; the calculatorโs aggregation check gives you confidence to update route-maps or BGP announcements without accidentally collapsing unintended ranges.
Firewall and ACL work is another everyday use case where mask formats matter deeply. Network devices and firewall rule engines often accept either a subnet mask or a wildcard mask; for example, a /24 network with mask 255.255.255.0 corresponds to a wildcard 0.0.0.255 used in many Cisco ACLs. The calculator converts between these formats for you and shows the exact command fragment you can paste into a rule. That small conversion step prevents the human error that produces an ACL permitting an entire class A when you intended a single subnet, a mistake easy to make if you mentally invert masks without a tool.
Edge cases and gotchas
Subnet arithmetic hides small traps that bite you in production if youโre not watching for them. The most common is the off-by-one error: counting usable hosts without excluding the network and broadcast addresses. That simple omission is the source of many โweโre out of IPsโ headaches. Modern practice mitigates some of this; RFC 3021 allows /31 subnets for point-to-point links, treating both addresses as usable, but you must be deliberate: older equipment and older habits still assume the network/broadcast exclusion. The calculator flags those special cases and explains when a /31 is a valid two-address point-to-point or when a /32 is simply a single-host route, so you donโt accidentally create an unreachable interface.
Notation and unit mistakes are deceptively common and can silently sabotage automation. People mix dotted-decimal masks with CIDR notation, forget to expand compressed IPv6 zeros, or paste a broadcast address into a host field and wonder why their configuration fails. Some platforms also have quirks: specific embedded devices and vintage routers donโt accept very small or very large prefixes, and a few vendor firmwares treat /31 and /32 differently.
The calculator helps prevent these problems by validating input, normalizing different notations, and explicitly showing when an address you entered is a network or broadcast. Use the tool’s copy-to-clipboard outputs rather than retyping addresses into CLIs or config templates; automation and copy-paste are your friends when trying to avoid human transcription errors.
How the calculator works under the hood
Under the hood, the calculator is straightforward, deterministic math: IP addresses and masks are converted to bitstrings, the network address is computed with a bitwise AND of the IP and mask, and the broadcast (IPv4) is calculated by OR-ing the inverted mask with the network. For IPv6, the same principle applies, but with larger integers and a different conceptual focus on prefixes instead of broadcast addresses; the implementation uses integer arithmetic capable of handling 128-bit values, so the prefix math is exact.
Validation routines detect malformed input, enforce correct prefix ranges, and handle the exceptional cases you expect, /31, /32, and /128, so results are both predictable and explainable. Suppose you enable the โshow stepsโ toggle. In that case, the calculator will print the intermediate binary math so you can see each masked bit flip and verify the result, which is helpful for teaching or for audits when a subnet decision needs to be explained to colleagues.
Practical tips for network engineers
When you design address plans, prefer fewer aggregated routes at higher levels of the topology; use supernets where you can to reduce BGP table size and improve stability, but reserve at least one extra subnet for expansion so you donโt force painful renumbering later. Documenting your allocations is not optional: give each subnet a human-friendly name (HQ-FLOOR1-VLAN10 paired with 10.10.10.0/24) and keep that mapping in a central spreadsheet or IPAM tool so operations teams can quickly understand who owns which block. Naming consistently, site, floor, function, speeds troubleshooting, and makes automated scripts far simpler.
For IPv6, adopt the standard rule of thumb: use /64 for LANs unless you have a specific reason not to. IPv6 practices emphasize delegations and policies over tight packing; carve large chunks for regional routers and avoid micromanaging everything down to tiny subnets unless your architecture requires it. At backbone or edge levels, reserve larger supernets and plan your delegation strategy to hand predictable blocks to downstream routers without frequent rework.
Use the calculatorโs binary toggle as a teaching tool. When onboarding new engineers, flip on the bit view and walk through why a/27 produces the numeric range it does; visualizing bit boundaries moves subnetting from arcane arithmetic into intuitive spatial thinking. In labs, try deliberately wrong masks and watch how the network and broadcast shift; that kind of guided failure teaches more than a dozen lecture slides.