Subnet Calculator

Enter an IPv4 address and a prefix length to get the network address, broadcast address, subnet mask, wildcard mask, usable host range, address class and binary form, and split the network into smaller subnets. Example: 192.168.1.130/24 is the network 192.168.1.0 with 254 usable hosts.

FreeNo sign-up

How to use the Subnet Calculator

  1. Type an IPv4 address, such as 192.168.1.130. You can add the prefix, like 10.0.0.5/20.
  2. Choose the prefix length from the list if you did not type it.
  3. Optionally pick how many equal subnets to split the network into.
  4. Press Calculate to see addresses, masks, hosts and the binary form.

Formula and method

Subnet mask = the first p bits set to 1. Network address = IP AND mask. Wildcard mask = NOT mask. Broadcast = network OR wildcard. Total addresses = 2^(32 – p). Usable hosts = 2^(32 – p) – 2, except /31 (2) and /32 (1). Splitting into 2^n subnets adds n bits to the prefix.

Worked example: 192.168.1.130/24

Item Value
Mask 255.255.255.0
Network 192.168.1.0
Broadcast 192.168.1.255
Usable range 192.168.1.1 to 192.168.1.254
Usable hosts 254

CIDR prefix cheat sheet

Prefix Subnet mask Addresses Usable hosts
/8 255.0.0.0 16,777,216 16,777,214
/16 255.255.0.0 65,536 65,534
/20 255.255.240.0 4,096 4,094
/22 255.255.252.0 1,024 1,022
/23 255.255.254.0 512 510
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2

Private IP ranges (RFC 1918)

Range CIDR Addresses
10.0.0.0 to 10.255.255.255 10.0.0.0/8 16,777,216
172.16.0.0 to 172.31.255.255 172.16.0.0/12 1,048,576
192.168.0.0 to 192.168.255.255 192.168.0.0/16 65,536

What subnetting is

Subnetting divides a network into smaller networks to limit broadcast traffic, improve security and make better use of addresses. The prefix length says how many bits identify the network, and the rest identify hosts.

Frequently asked questions

How do I calculate a subnet?

AND the IP address with the subnet mask to get the network address, then OR with the wildcard mask to get the broadcast address.

How many usable hosts are in a /24?

254. A /24 has 256 addresses, minus the network and broadcast addresses.

What is the subnet mask for /26?

255.255.255.192, with 62 usable hosts.

What is a wildcard mask?

The inverse of the subnet mask, used in access lists and routing configuration.

What is CIDR notation?

An address followed by a slash and the prefix length, such as 10.0.0.0/8.

What are private IP addresses?

Addresses reserved for internal networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

Sources

Related calculators

Browse all calculators

Related to This Article

What people say about "Subnet Calculator: IPv4 CIDR, Masks, Hosts, Binary & Subnet Splitting"?

No one replied yet.

Leave a Reply