What the CIDR calculator does

CIDR notation writes an address block as address/prefix: 192.168.1.0/24 says the first 24 bits identify the network and the remaining 8 bits identify hosts. The tool decodes that notation and shows the network address, the broadcast address for IPv4 blocks, the usable host range, the subnet mask, the wildcard mask and the total number of addresses.

It is meant for anyone writing firewall rules, adding a CDN’s IP ranges to an .htaccess allow list, planning subnets in a cloud network or wondering which block an IP from a log line falls into. IPv6 is computed with BigInt at full 128-bit precision, so nothing is rounded.

How to use

  • Type the address as 10.20.30.40/22, 2001:db8::/48 or with a mask, 192.168.1.10 255.255.255.0. Without a prefix a single address (/32 or /128) is assumed and a notice says so.
  • The result table updates 150 ms after you stop typing; there is no separate calculate button.
  • Put an IP in the “In range?” field to see whether it belongs to the block.
  • To split, pick a method: number of subnets (rounded up to a power of two) or a new prefix length. At most 256 subnets are listed.
  • Copy the result as plain text or JSON, and optionally include the inputs in the share link.

Calculation rules

The network address is the input with its host bits cleared. If the input has host bits set, such as 192.168.10.77/26, the tool does not reject it; it shows the real network (192.168.10.64/26) with a notice. For IPv4 blocks of /30 and larger, the first address is the network and the last is the broadcast address, so usable hosts are the total minus two.

  • /31: under RFC 3021 both addresses are usable on point-to-point links and there is no broadcast address.
  • /32 and /128 describe a single address.
  • IPv6 has no broadcast. The network address is the Subnet-Router anycast address from RFC 4291, so the first usable address is the next one; on /127 links both addresses are usable per RFC 6164.
  • IPv6 output follows RFC 5952: lower case, with the longest run of zero groups shortened to ::. The expanded form is listed as well.

Parsing is deliberately strict. Leading zeros such as 010.1.1.1 are rejected because some systems read them as octal; shorthand IPv4 like 127.1, zone identifiers like fe80::1%eth0 and non-contiguous masks are not accepted either. If you enter a wildcard mask such as 0.0.0.255, the tool recognises it and suggests the matching prefix.

Special-purpose address ranges

The block is compared with a curated list taken from the IANA special-purpose address registries, and the narrowest range that fully contains it is shown. A block that spans several types is marked as mixed.

RangeTypeSource
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private networkRFC 1918
100.64.0.0/10Carrier-grade NAT (CGNAT)RFC 6598
127.0.0.0/8, ::1/128LoopbackRFC 1122, RFC 4291
169.254.0.0/16, fe80::/10Link-localRFC 3927, RFC 4291
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, 2001:db8::/32DocumentationRFC 5737, RFC 3849
224.0.0.0/4, ff00::/8MulticastRFC 5771, RFC 4291
fc00::/7Unique local address (ULA)RFC 4193

Example and interpretation

The example button enters 192.168.10.77/26. Result: network 192.168.10.64/26, broadcast 192.168.10.127, usable range 192.168.10.65 – 192.168.10.126, 62 hosts, mask 255.255.255.192, wildcard 0.0.0.63. The type is an RFC 1918 private network, so the block is not routed directly on the internet.

In the same example 192.168.10.100 falls inside the block. With 3 in the split field the tool rounds up to 4, shows a notice and lists four /28 subnets starting at .64, .80, .96 and .112, each with 14 hosts. For IPv6, entering 2001:db8:abcd::/48 with a new prefix of 64 would create 65,536 subnets, so the tool declines to list them and explains the limit.

Limits and privacy

The tool only does arithmetic: no DNS lookup, ping, WHOIS or geolocation. It cannot tell you who an address belongs to or whether it is online. The special-range list is a curated subset of the IANA registries, and a block that looks public is not necessarily announced on the internet.

Splits are capped at 256 subnets and inputs at 100 characters. Addresses you type are never sent to a server; they are added to the share link only when you tick that option. Reserved anycast addresses from RFC 2526 are not subtracted from the host count.

Frequently asked questions

How many IP addresses are in a /24?

256 addresses. Without the network and broadcast address, 254 usable hosts remain. In general a block holds 2^(32 − prefix) addresses.

Why does a /31 have no broadcast address?

RFC 3021 allows both addresses of a two-device point-to-point link to be used as hosts, so the tool shows two usable addresses for a /31.

How do I convert a subnet mask to a prefix length?

Type the mask after the address with a space, for example 10.0.0.1 255.255.240.0. The tool checks that the mask is contiguous and shows it as /20.

Why is my IPv6 address written differently?

One address can be written many ways. The tool uses the canonical RFC 5952 form: lower case, no leading zeros and the longest run of zero groups shortened to ::. The expanded form is listed too.

Does this tool show who owns an IP?

No. It makes no network request, so it cannot report ownership, location or reachability; it only calculates the block structure and the special-purpose range type.

Published: · Updated: