Subnet Calculator
Derive network, broadcast, host range and masks from CIDR notation — IPv4 and IPv6, all in your browser.
IPv4 CIDR
Examples
Calculate a /24 from a host address
192.168.1.42/24Network: 192.168.1.0
Broadcast: 192.168.1.255
Usable range: 192.168.1.1 – 192.168.1.254
Subnet mask: 255.255.255.0
Wildcard mask: 0.0.0.255
Total addresses: 256
Usable hosts: 254Host bits are cleared for the network and set for the broadcast address, producing the standard /24 range.
Handle an RFC 3021 point-to-point subnet
10.0.0.8/31Network: 10.0.0.8
Broadcast: 10.0.0.9
Usable range: 10.0.0.8 – 10.0.0.9
Subnet mask: 255.255.255.254
Wildcard mask: 0.0.0.1
Total addresses: 2
Usable hosts: 2For /31, both addresses are treated as usable instead of subtracting network and broadcast addresses.
Expand an IPv6 /64 prefix
2001:db8:abcd:12::/64Compressed: 2001:db8:abcd:12::
Expanded: 2001:0db8:abcd:0012:0000:0000:0000:0000
Prefix length: /64
Total addresses: 18,446,744,073,709,551,616IPv6 mode normalizes the address and computes 2^(128−64) addresses; it does not mask host bits into a separate network address.
About this tool
Subnetting turns a single IP block into the network address, broadcast address, usable host range and masks your routers, firewalls and DHCP scopes actually need. Getting a CIDR prefix wrong by one bit silently changes all of those values, so this calculator does the bit math for you: enter an address in CIDR notation and read every derived value at a glance.
It handles the tricky edge cases correctly — a /31 point-to-point link has two usable addresses per RFC 3021, and a /32 is a single host route — and shows a colour-coded 32-bit map so you can see exactly where the network portion ends and the host portion begins. An IPv6 mode summarizes a prefix's compressed and expanded forms and the total number of addresses in the block. Everything is computed locally; no address you enter is uploaded.
How to use this tool
Enter a CIDR block
Type an IPv4 address with a prefix, e.g. 192.168.1.0/24, or switch to IPv6 mode for a prefix like 2001:db8::/32.
Read the subnet details
See the network and broadcast addresses, usable host range, subnet mask, wildcard mask and host counts instantly.
Inspect the bit map
Use the coloured 32-bit map to see how many bits belong to the network vs. the host portion.
Copy any value
Copy the network, mask or host range to paste into router configs, ACLs or documentation.
Use cases
Planning a VLAN or DHCP scope
Derive network boundaries, broadcast address and usable IPv4 range before assigning hosts.
Writing firewall and routing rules
Copy the canonical network CIDR, dotted mask or wildcard mask into an ACL or route configuration.
Checking point-to-point links
Confirm both addresses in an IPv4 /31 are usable under RFC 3021.
Normalizing IPv6 notation
Convert a compressed IPv6 address to eight zero-padded groups and calculate the prefix address count.
What it derives
| Value | Meaning |
|---|---|
| Network address | The first address of the block — identifies the subnet |
| Broadcast address | The last address — reaches every host on the subnet (IPv4) |
| Usable host range | First to last assignable host address |
| Subnet mask | Dotted-decimal mask for the prefix (e.g. 255.255.255.0) |
| Wildcard mask | Inverse mask used by ACLs and OSPF |
| Usable hosts | Host count, with RFC 3021 (/31) and /32 handled correctly |
IPv4 and IPv6 supported — all math runs in your browser.
Common mistakes
Mistake:Entering a host address and assuming it is already the network address.
Fix:Use the calculated Network address and canonical CIDR row; host bits may change the entered value.
Mistake:Subtracting two usable addresses from every IPv4 block.
Fix:Respect the calculator's /31 and /32 handling: /31 has two usable point-to-point addresses and /32 represents one host.
Mistake:Reading Public as proof that an address is globally routable.
Fix:The classification only recognizes RFC 1918 private ranges; separately check loopback, link-local, documentation and other special-purpose space.
Mistake:Assuming IPv6 mode calculates the masked network boundary.
Fix:Use it for expansion, compression, prefix length and address count only; mask host bits with a dedicated IPv6 subnet tool when needed.
Frequently asked questions
What does a CIDR calculation show?
For IPv4 it shows the network and broadcast addresses, masks, usable host range and a 32-bit network/host map. IPv6 mode summarizes compressed and expanded prefixes and address totals.
How are /31 and /32 handled?
A /31 has two usable addresses for point-to-point links per RFC 3021, while a /32 represents one host route.
Is my IP address uploaded?
No. Subnet calculations run locally in the browser and entered addresses are not uploaded.
Related guides
IPv6 Addressing Explained: Expanding and Compressing Addresses
How IPv6 addresses are structured, the rules behind the :: shorthand and leading-zero omission, and how to canonicalize an address per RFC 5952.
Subnetting Without the Headache: A Practical CIDR Guide
How CIDR notation, subnet masks, network and broadcast addresses actually work — with the /31 and /32 edge cases most people get wrong.
References & standards
Related tools
API Mock Server
Define mock REST routes and intercept fetch calls client-side
Bandwidth Calculator
Estimate how long a file takes to transfer at a given connection speed — correctly handling bits vs bytes (Mbps vs MB/s) and SI vs binary size units
Broken Link Checker
Extract http(s) links from pasted HTML and check them via proxy
cURL to Code Converter
Convert cURL commands to code snippets in multiple languages. Parse cURL and generate JavaScript, Python, PHP, and more.
DNS Lookup Tool
Query DNS records and resolve domain names to IP addresses
DNS Propagation Checker
Compare DNS answers from global public resolvers and see propagation consensus instantly