Subnet Calculator Widget
Add a subnet calculator to your networking tutorials. Readers enter an address with a prefix or netmask and get the network and broadcast addresses, usable host range, wildcard mask and host count, and can split the block into smaller subnets.
Live preview
Exactly what your visitors will seeUnder the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/subnet-calculator" title="Subnet Calculator by A2Z Tools" width="100%" height="580" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="subnet-calculator" data-height="580"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
The widget runs the same IP engine as the A2Z IP / CIDR Subnet Calculator. It accepts CIDR notation (192.168.1.10/24), an address followed by a dotted netmask, or an IPv6 prefix. The network address is the input with its host bits cleared and the broadcast address has them all set; the usable range sits between them. /31 and /32 are handled as RFC 3021 and host routes, where every address is usable. Leading-zero octets such as 010.0.0.1 are refused because some systems read them as octal. The address type (private RFC 1918, carrier-grade NAT, loopback, documentation and so on) is identified, and an optional split lists the child subnets of a longer prefix.
Calculation method
- Mask = 32 - prefix high bits set; wildcard = NOT mask
- Network = address AND mask; broadcast = network OR wildcard
- Usable hosts = 2^(32 - prefix) - 2 for /0-/30; 2 for /31 (RFC 3021); 1 for /32
- Split into /n: 2^(n - prefix) blocks of 2^(32 - n) addresses (first 64 listed)
Limitations
- No VLSM planner: splitting uses one new prefix length for every child, and only the first 64 child subnets are listed.
- Cloud providers reserve extra addresses (AWS and Azure keep 5 per subnet), which the usable-host count does not subtract.
- It does not summarise or aggregate several networks into a supernet, and does not check whether an address is actually in use.
- IPv6 output covers network, range and counts only; there is no EUI-64 or SLAAC interface-ID calculation.
Where publishers use it
- CCNA and network-engineering course pages
- Cloud tutorials planning VPC and subnet ranges on AWS, Azure or GCP
- Home-lab and self-hosting blogs setting up VLANs
- Firewall and ACL documentation that uses wildcard masks
Questions
Why are two addresses not usable?
In a normal IPv4 subnet the first address identifies the network and the last is the broadcast address. /31 point-to-point links are the exception and use both.
What is a wildcard mask?
The inverse of the subnet mask, used by Cisco ACLs and OSPF: 255.255.255.0 becomes 0.0.0.255.
Can I enter a netmask instead of a prefix?
Yes, for example 10.0.0.1 255.255.255.0 or 10.0.0.1/255.255.255.0. Non-contiguous masks are rejected.
Does it work for IPv6?
Yes, for network, range and address counts. IPv6 has no broadcast or wildcard mask, so those rows are omitted.
Sources
- RFC 4632: Classless Inter-domain Routing (CIDR) - IETF . Prefix notation and address blocks
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links - IETF . Both /31 addresses usable
- RFC 1918: Address Allocation for Private Internets - IETF . 10/8, 172.16/12, 192.168/16
- RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space - IETF . 100.64.0.0/10 carrier-grade NAT
- IANA IPv4 Special-Purpose Address Registry - IANA . Loopback, documentation and other special ranges used for the address type
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Subnet Calculator https://a2z.tools/ip-cidr-subnet-calculator
<a href="https://a2z.tools/ip-cidr-subnet-calculator">A2Z Tools Subnet Calculator</a>
[A2Z Tools Subnet Calculator](https://a2z.tools/ip-cidr-subnet-calculator)
Subnet Calculator by A2Z Tools - https://a2z.tools/ip-cidr-subnet-calculator
Related widgets
-
Live epoch time, timestamp to date (seconds to nanoseconds detected) and date to timestamp.
-
Test a JavaScript regular expression: highlighted matches, capture groups and a replace preview.
-
MD5, SHA-1, SHA-256, SHA-384 and SHA-512 of any text, in hex or Base64.
-
Pretty-print, minify or validate JSON, with the line and column of the first syntax error.
-
Convert a JSON array of objects to CSV and CSV back to JSON, with RFC 4180 quoting.
-
Encode text to Base64 or decode it, with proper UTF-8 and an optional URL-safe alphabet.