Skip to content
ToolZone

Subnet / CIDR Calculator

Calculate network address, broadcast address, subnet mask, and usable host range from any IP and CIDR prefix.

Runs in your browser. Nothing you enter or upload leaves your device.

Network address
192.168.1.0
Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Total addresses
256
Usable hosts
254
What these terms mean
CIDR (Classless Inter-Domain Routing) prefix (/24)

The number after the slash tells you how many bits of the 32-bit address are fixed as the "network" part. A smaller number (like /8) means a huge network; a larger one (like /30) means a tiny one.

Network address

The first address in the range. It identifies the subnet itself and can't be assigned to a device.

Broadcast address

The last address in the range, reserved for sending a message to every device on the subnet at once.

Subnet mask

Another way of writing the same CIDR prefix — it marks which bits of an IP are the network part vs. the host part.

Usable hosts

Total addresses minus 2 (the network and broadcast addresses, which can't be assigned to devices). A /31 or /32 is a special case used for point-to-point links, so it has 0 "usable" hosts by this definition.

First / last usable host

The actual range of IPs you can assign to devices — routers, computers, servers — on this subnet.

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Subnet / CIDR Calculator

This Subnet / CIDR Calculator takes an IPv4 address and a prefix length like /24 and works out everything about that network: where it starts and ends, its masks, and how many hosts it can hold. It is aimed at network admins, cloud engineers, and students learning IP addressing.

How it works

The IP address is converted to a 32-bit number. The prefix length says how many leading bits belong to the network, so /24 creates a mask of 24 ones followed by 8 zeros, which is 255.255.255.0. A bitwise AND of the IP and the mask gives the network address; setting all host bits to 1 gives the broadcast address. The wildcard mask is the inverse of the subnet mask.

Total addresses equals 2 raised to the number of host bits (32 minus the prefix). Usable hosts is that number minus 2, because the network and broadcast addresses cannot be assigned. For /31 and /32, the tool reports 0 usable hosts and shows the network and broadcast addresses as the first and last host.

How to use

  1. 1

    Type an IPv4 address, such as 10.0.5.77, into the IP address field.

  2. 2

    Enter the prefix length (0-32) in the CIDR prefix field.

  3. 3

    Read the network, broadcast, mask, host range, and address counts in the result cards.

Worked examples

A typical home network

The default 192.168.1.0/24 LAN.

Input
192.168.1.0 /24
Result
Network 192.168.1.0, Broadcast 192.168.1.255, Mask 255.255.255.0, Wildcard 0.0.0.255, Hosts 192.168.1.1 to 192.168.1.254, Total 256, Usable 254

Finding the subnet of a host

Which /20 block does 10.0.5.77 belong to?

Input
10.0.5.77 /20
Result
Network 10.0.0.0, Broadcast 10.0.15.255, Mask 255.255.240.0, Wildcard 0.0.15.255, Hosts 10.0.0.1 to 10.0.15.254, Total 4,096, Usable 4,094

With 12 host bits, the third octet is masked with 240, so 5 rounds down to 0.

A point-to-point link

A small /30 between two routers.

Input
172.16.0.9 /30
Result
Network 172.16.0.8, Broadcast 172.16.0.11, Mask 255.255.255.252, Hosts 172.16.0.9 to 172.16.0.10, Total 4, Usable 2
Limitations
IPv4 only; IPv6 addresses are not supported. It calculates a single subnet and does not split a block into smaller subnets. /31 links are shown with 0 usable hosts, although RFC 3021 allows both addresses to be used on point-to-point links.
Assumptions
The address is a dotted-decimal IPv4 address with four octets from 0 to 255. Usable hosts excludes the network and broadcast addresses.
Privacy
The calculation runs in your browser; the addresses you enter are not sent anywhere or saved.

Frequently asked questions

What's the difference between a /24 and a /16?+

A /24 has 256 addresses (254 usable), while a /16 has 65,536 (65,534 usable). The smaller the number after the slash, the larger the network.

Why are the network and broadcast addresses not usable?+

The first address identifies the subnet itself and the last is reserved for messages to every device on it, so neither is assigned to a single device.

What is a wildcard mask?+

It is the inverse of the subnet mask: 0 bits must match and 1 bits can be anything. For a /24, the subnet mask 255.255.255.0 becomes the wildcard 0.0.0.255. Cisco ACLs and OSPF use this form.

How do I convert a subnet mask to CIDR?+

Count the 1 bits in the mask. 255.255.255.0 has 24, so it is /24; 255.255.240.0 has 20, so it is /20.

Can I enter any IP inside the subnet?+

Yes. Enter any host address and prefix, and the calculator works out the network it belongs to and that network's full range.

Related tools