Skip to content

Free subnet calculator

Enter an IPv4 address and prefix length to get the subnet mask, network and broadcast addresses and the usable host range. It runs in your browser.

FreeNo signupRuns in your browser

CIDR notation, for example 10.0.0.0/8 or 192.0.2.130/26

Network address192.0.2.128/26
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Broadcast address192.0.2.191
First usable host192.0.2.129
Last usable host192.0.2.190
Total addresses64
Usable hosts62
[01/How it works]

Using the subnet calculator

1

Enter an IPv4 address with a CIDR prefix, such as 198.51.100.0/26.

2

Read the subnet mask, network address, broadcast address and host range.

3

Change the prefix length to see larger or smaller subnets.

[02/Background]

What this tool is telling you

How CIDR notation works

An IPv4 address is 32 bits long. CIDR notation, written as an address followed by a slash and a number, says how many of the first bits identify the network. In 198.51.100.0/26, the first 26 bits are the network and the remaining 6 bits identify hosts. A longer prefix means a smaller network. The same prefix can be written as a subnet mask: /26 equals 255.255.255.192, where the binary ones in the mask mark the network portion.

Counting addresses and hosts

A subnet with prefix length p holds 2^(32 - p) addresses. A /26 holds 2^6, which is 64 addresses. Normally the first address is the network address and the last is the broadcast address, so usable hosts are the total minus 2, which is 62 for a /26. A /24 gives 256 addresses and 254 hosts. Two special cases: a /31 is allowed on point-to-point links and has two usable addresses, and a /32 is a single host.

Planning subnets

Size each subnet for current need plus growth, then round up to the next power of two. A network that needs 40 hosts requires a /26, since a /27 holds only 30 usable hosts. Allocate the largest subnets first so smaller ones fit cleanly in the remaining space, and keep each block aligned to its size, since a /26 must start on a multiple of 64. IPv6 follows the same idea, with /64 as the standard subnet size for a LAN.

[03/FAQ]

Subnet Calculator questions

What is the difference between a subnet mask and CIDR?

They say the same thing in two formats. A mask of 255.255.255.0 is the same as /24.

Why subtract 2 from the address count?

The first address names the network and the last is the broadcast address, so neither is assigned to a host.

Which ranges are safe to use in examples?

Documentation ranges such as 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for examples and will not collide with real networks.

Does this tool send my addresses anywhere?

No. It calculates in your browser, with no daily limit and no account.

[ Validate ][ Enrich ]
[Get started]

Run your first lookup in two minutes

Create a key, pick a plan and call any product in the catalog. Plans start at $29 a month.

[ Screen ][ Scrape ]