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.

Developer Tools Calculator Runs in your browser Free · no ads

Customize your widget

Theme
Auto follows the visitor's light/dark setting.
Style
Attribution on your page
Optional and entirely your choice. The exact line is shown in the code below; it links to the tool with rel="nofollow".
More options
Starting values
Leave blank to use the widget's defaults. Visitors can still change every value.

Live preview

Exactly what your visitors will see

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.

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

  1. RFC 4632: Classless Inter-domain Routing (CIDR) - IETF . Prefix notation and address blocks
  2. RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links - IETF . Both /31 addresses usable
  3. RFC 1918: Address Allocation for Private Internets - IETF . 10/8, 172.16/12, 192.168/16
  4. RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space - IETF . 100.64.0.0/10 carrier-grade NAT
  5. 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

Preview