Subnet Calculator (IPv4 CIDR)
Enter an IP and CIDR to instantly get the netmask, network, broadcast, host range and total number of addresses.
Updated: June 26, 2026
What does this subnet calculator do?
This tool takes an IPv4 address together with a CIDR prefix (for example
192.168.1.10/24) and works out every detail of the network
block: the subnet mask, wildcard mask, network address, broadcast address,
first and last usable host, the total number of addresses and the number of
assignable hosts. Everything is computed in your browser with JavaScript —
no IP is ever sent to a server, so it is safe to use even with sensitive
internal ranges.
How to read the results
CIDR and subnet mask
The CIDR prefix tells you how many leading bits of the address belong to the
network. If subnetting is new to you, our guide on
what a subnet is walks through the
fundamentals, and the
subnetting cheat sheet lists
every prefix at a glance. A /24 means 24 network bits, leaving 8 bits for hosts →
a mask of 255.255.255.0 and 256 addresses. Each bit you add to
the prefix halves the number of hosts: a /25 gives 128
addresses, a /26 gives 64, and so on.
Network, broadcast and the host range
The network address is the lowest address in the block (all host bits set to 0) and is not assigned to a device. The broadcast address is the highest (all host bits set to 1) and is used to reach every host in the subnet at once. The addresses in between make up the usable host range you assign to servers, routers and devices.
Special cases: /31 and /32
Per RFC 3021, a /31 network is used for point-to-point links and
uses both addresses as hosts (there is no separate broadcast). A
/32 describes a single host — handy when writing a firewall rule
or a route for exactly one machine. To see the full first-and-last address
span of any block, use the
CIDR to IP range converter.
Real-world examples
-
Split an office
/24into four/26blocks for separate VLANs, each with 62 hosts. - Check whether an address falls inside the allowed range of an AWS security group before opening a port.
-
Quickly confirm that
10.0.0.0/8,172.16.0.0/12and192.168.0.0/16are private ranges (RFC 1918) when designing an internal network — see how IP addresses work for the difference between public and private space. - Planning IPv6 instead? Switch to the IPv6 subnet calculator for prefix and address-count math on 128-bit networks.
Why calculating subnets by hand is error-prone
The most common mistake is getting the subnet boundary wrong when the prefix
is not on an octet boundary (/26, /27…). Setting the
wrong network address can leave a whole range unroutable, or worse, overlap
with another subnet and cause IP conflicts that are painful to track down.
Double-checking with a calculator before you push config to a router, a
firewall or a Terraform file is always cheaper than debugging a network
outage at 2 a.m.
Frequently asked questions
What is the subnet mask for a /24?
A /24 prefix corresponds to the subnet mask 255.255.255.0, which gives 256 total addresses and 254 usable hosts (excluding the network and broadcast addresses).
What's the difference between CIDR and a subnet mask?
They are two ways of writing the same information. CIDR (for example /26) counts the number of network bits; the subnet mask (255.255.255.192) expresses those same bits as four octets. This calculator converts between the two for you.
Why does a /30 have only 2 usable hosts?
A /30 has 4 total addresses. One is reserved for the network address and one for the broadcast address, leaving 2 to assign to devices — just enough for a point-to-point link.
Does this tool send my IP address anywhere?
No. All calculations run in JavaScript directly in your browser. No network request ever contains the data you enter, so it is safe to use with internal IP ranges.
Network management & IPAM tools worth considering
Calculating subnets by hand is fine for one-offs, but once you manage hundreds of IP ranges an IPAM/monitoring platform prevents overlaps and documents everything automatically:
- IP address management (IPAM) Track subnet ownership, detect conflicts and manage DNS/DHCP centrally — instead of a manual IP spreadsheet.
- Network monitoring platforms Auto-discover topology, alert when a subnet runs out of addresses and visualize traffic between VLANs.
Learn more
- What Is a Subnet? CIDR Notation Explained Subnets and CIDR notation explained in plain English — what /24 really means, how masks work, and how to divide a network without the headache.
- IPv4 vs IPv6: What's the Difference? Why the internet is slowly moving from IPv4 to IPv6 — the address exhaustion problem, what actually changed, and how the two run side by side.
- What Is an IP Address? What an IP address is and how it routes your traffic — public vs private, static vs dynamic, and why your phone and your router don't share the same one.