whatsmyip.tr

Tools / Subnet calculators

CIDR Calculator

Enter a network in CIDR notation to get its address range, masks and size. Works with IPv4 and IPv6.

Any address inside the block works, for example 10.20.30.40/20 or 2001:db8:abcd::/48.

How CIDR notation works

CIDR (classless inter-domain routing) writes a network as an address followed by a prefix length, such as 172.16.8.0/22. The prefix length says how many bits are fixed. Every extra bit in the prefix halves the block: a /23 holds 512 addresses, a /24 holds 256, a /25 holds 128.

Common IPv4 prefix sizes

PrefixSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

Subnet mask and wildcard mask

The subnet mask has a 1 for every network bit and a 0 for every host bit. The wildcard mask is its inverse and is what Cisco-style access lists and OSPF network statements expect: 0.0.0.255 matches the same addresses as the mask 255.255.255.0.

Questions and answers

What does the number after the slash mean?

It is the prefix length: how many leading bits of the address identify the network. The remaining bits identify hosts. /24 leaves 8 host bits, which is 256 addresses.

Why are two addresses not usable in an IPv4 subnet?

The first address names the network itself and the last is the broadcast address. Both are reserved, so a /24 has 254 usable host addresses. The exceptions are /31, used for point-to-point links with two usable addresses (RFC 3021), and /32, a single host.

Does IPv6 have a broadcast address?

No. IPv6 uses multicast instead, so every address in a prefix can be assigned. The calculator therefore shows only the first and last address of an IPv6 block.

What prefix should an IPv6 LAN use?

A /64, almost always. Stateless address autoconfiguration (SLAAC) and several other IPv6 features assume a 64-bit interface identifier.