Network & Ops

Subnet Calculator

All tools

Type an IPv4 CIDR and get the network, broadcast, netmask and usable host range.

How it works

Four simple steps

1

Enter the CIDR

Type an IPv4 address with a prefix, such as /24.

2

Calculate

Click Calculate to mask the address.

3

Read the JSON

Network, broadcast, netmask, host range and count.

4

Use the range

Copy values into firewall rules or an IP plan.

Subnet Calculator

About Subnet Calculator

You are carving a VPC into subnets, or a firewall ticket says 172.16.8.0/21 and you need to know where that range ends. Doing the bit math in your head is slow and error-prone. Subnet Calculator answers from one line of input.

Enter an address with a prefix length, such as 192.168.1.0/24, and click Calculate. The result is a small JSON object with the network address, broadcast address, netmask in dotted form, first usable host, last usable host, the number of usable hosts and the prefix. The address you type does not have to be the network address: 10.0.5.77/22 is masked down to 10.0.4.0, which is a quick way to find which subnet an IP belongs to.

Usable hosts are the total addresses minus two, for the network and broadcast addresses. For /31 and /32 the tool reports zero usable hosts and sets the first and last host to the network and broadcast addresses. In practice /31 is often used for point-to-point links, where both addresses are usable, and /32 identifies a single host, so read those two cases with that in mind. Cloud providers also reserve a few addresses in each subnet, so check your platform's documentation before sizing a subnet to the exact host count.

To check a whole list of blocks for overlaps or merge them, move to the CIDR Toolbelt. Other utilities are on the network and ops page. The math is done with 32-bit integers in your browser.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

No. The input must be CIDR notation with a slash and a prefix from 0 to 32. A mask of 255.255.255.0 is /24, 255.255.252.0 is /22, and each extra bit of 1s adds one to the prefix.

The calculator applies the classic rule of subtracting the network and broadcast addresses, which leaves nothing for /31 and /32. Point-to-point links commonly use both /31 addresses, so treat that result as two usable addresses in that setting.

Not directly. The wildcard mask is the netmask with each octet subtracted from 255, so a 255.255.240.0 netmask has a wildcard of 0.0.15.255.

View more FAQs

Related tools

View all

CIDR Toolbelt

Merge, overlap-check, and diff IPv4 CIDR lists for security groups.

Open

HTTP Status Codes

Browse and search HTTP status codes with plain-English meanings.

Open

User-Agent Parser

Parse browser user-agent strings into readable components.

Open

HTML Formatter

Beautify and indent HTML markup.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools