CIDR / Subnet Calculator

Subnet math for IPv4 and IPv6 — ranges, masks and host counts.

Runs in your browser Instant No sign-up
CIDR or IP + mask
Subnet

Paste, type or drop a file — output appears as you type.

Waiting for input
Processed locally · nothing is uploadedProcessed locally

How to use it

Paste a CIDR block or an address with a netmask, one per line. For IPv4 the calculator shows:

Address           192.168.10.77/26
Note              192.168.10.77 is a host inside 192.168.10.64/26
Network           192.168.10.64/26
Netmask           255.255.255.192
Wildcard          0.0.0.63
Broadcast         192.168.10.127
First host        192.168.10.65
Last host         192.168.10.126
Total addresses   64
Usable hosts      62
Type              Private (RFC 1918)

The output also shows the netmask and address in binary and the address in hex, which helps when you are reading packet captures or firewall rules. When the address you entered is not the network address, a Note line says which network it belongs to.

Reading the results

  • Network is the address with all host bits set to zero. Broadcast has all host bits set to one.
  • Usable hosts is the total minus the network and broadcast addresses. The exceptions are /31, where both addresses are usable per RFC 3021, and /32, which is a single host.
  • Type recognizes private ranges (10/8, 172.16/12, 192.168/16), carrier-grade NAT (100.64/10), loopback, link-local, multicast, documentation ranges and reserved space. Everything else is Public.

Invalid input returns a clear error, such as 255.255.0.255 is not a contiguous subnet mask. or Prefix /33 is out of range for IPv4 (0–32). In batch mode, an invalid line is marked with ✗ and the other lines are still calculated.

IPv6

IPv6 prefixes work the same way:

Network          2001:db8::/32
First address    2001:db8::
Last address     2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
Total addresses  79,228,162,514,264,337,593,543,950,336  (2^96)
/64 subnets      4,294,967,296
Type             Documentation (RFC 3849)

IPv6 has no broadcast address, so only the range is shown. Subnets are usually allocated as /64, so the calculator shows how many /64 networks fit in any shorter prefix. Unique local (fc00::/7), link-local (fe80::/10), multicast and global unicast addresses are identified.

Choosing a subnet size

Each step down in prefix length doubles the size of the block: a /24 has 256 addresses, a /23 has 512 and a /22 has 1,024. Cloud providers reserve a few addresses in every subnet on top of the network and broadcast, so leave headroom rather than sizing a subnet to the exact number of hosts.

When it helps

  • Planning cloud networks. Check that VPC and subnet ranges don’t overlap before you create them.
  • Writing firewall rules. Copy the wildcard mask for ACLs, or confirm that an address falls inside an allowed range.
  • Reading logs. Paste an address to see whether it is private, CGNAT or public.

Related tools: convert addresses to hex or binary with the Number Base Converter, check file permissions on a server with the Chmod Calculator, or decode query strings in logged URLs with URL Encode.

Frequently asked questions

What input formats are accepted?

CIDR notation such as 192.168.1.0/24, an address followed by a dotted netmask such as 10.0.0.1 255.255.255.252, a bare address (treated as /32 or /128), and IPv6 prefixes such as 2001:db8::/48. Put one range per line to calculate up to 50 at once.

Why do /31 and /32 show no broadcast address?

A /32 is a single host. A /31 has two addresses and, per RFC 3021, both are usable on point-to-point links, so there is no network or broadcast address to reserve. For /30 and larger, the first address is the network and the last is the broadcast.

What is a wildcard mask?

The inverse of the netmask: bits that may vary are 1. Cisco ACLs and OSPF network statements use wildcard masks, so 255.255.255.192 becomes 0.0.0.63.

How are IPv6 prefixes shown?

The calculator shows the network, the first and last address, the exact total as a full number (it can exceed 10^30), the number of /64 subnets for prefixes of /64 or shorter, the address type and the fully expanded address. Addresses are printed in RFC 5952 canonical form.

Is the input uploaded?

No. All subnet math runs in your browser.

Last updated