Subnet Calculator

Enter an IPv4 address with a CIDR prefix (192.168.1.10/24) or a netmask (192.168.1.10 255.255.255.0).

Common prefix lengths
CIDRNetmaskWildcardTotal addressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/16255.255.0.00.0.255.25565,53665,534
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342

Frequently asked questions

How do I calculate the subnet mask of an IP address?

An IP address on its own does not contain a mask. The mask comes from the network's prefix length, written after a slash, such as /24. The prefix is the number of leading 1 bits: /24 is 24 ones followed by 8 zeros, which is 255.255.255.0 in dotted form. Enter the address with its prefix, like 192.168.1.10/24, and this calculator shows the mask.

How many usable hosts are in a subnet?

Take 2 to the power of (32 minus the prefix length), then subtract 2 for the network and broadcast addresses. For a /26 that is 2^6 = 64, minus 2, so 62 usable hosts. Two prefixes are special: /31 has 2 usable addresses (point-to-point links, RFC 3021) and /32 is a single host.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation writes an IP address followed by a slash and the prefix length, for example 10.0.0.0/8. It replaced the old fixed class A, B and C network sizes and lets a network be any size from /0 to /32.

What is a wildcard mask?

A wildcard mask is the inverse of the subnet mask. Where the netmask has a 1 the wildcard has a 0, and the other way round. For 255.255.255.0 the wildcard is 0.0.0.255. Router access control lists on platforms such as Cisco IOS use wildcard masks to match ranges of addresses.

What are the private IPv4 ranges?

Three ranges are reserved for private networks (RFC 1918): 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. They are not routed on the public internet.