Skip to content
ZeroServer.tools

Subnet & CIDR Calculator

Local processing guarantee: IP math executed entirely client-side. No data is sent to servers.

Network Configuration

Enter CIDR range (e.g. 24) or Dotted-decimal (e.g. 255.255.255.0).
Initializing calculations...

Understanding IPv4 Subnetting & CIDR

Subnetting is the practice of dividing a physical or logical network into smaller, logical sub-networks (subnets). CIDR (Classless Inter-Domain Routing) was introduced in 1993 to replace the older, rigid Classful network design (Class A, B, and C). It uses the variable-length subnet masking (VLSM) notation where the slash (/) signifies the exact number of bits reserved for the Network ID.

RFC 1918 Private Ranges

Private IP addresses are reserved for internal use within a local area network (LAN) and are not routable on the public internet. They include:

  • 10.0.0.0/8 (10.0.0.0 – 10.255.255.255): Single large network.
  • 172.16.0.0/12 (172.16.0.0 – 172.31.255.255): 16 contiguous Class B networks.
  • 192.168.0.0/16 (192.168.0.0 – 192.168.255.255): 256 local networks, extremely common for home networks.

Special Addresses

Within any IPv4 subnet, the first and last address are reserved for special purposes:

  • Network Address: The first address in the subnet (host bits all set to 0). Identifies the subnet itself.
  • Broadcast Address: The last address in the subnet (host bits all set to 1). Used to transmit packets to all hosts in the subnet.
  • Gateway: Typically the first usable address (e.g. .1) or last usable address (e.g. .254) is assigned to the local router interface.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Working out the usable host range for a CIDR block.
  • Checking whether two addresses are in the same subnet.
  • Splitting a block into smaller subnets for a network plan.
  • Converting between a prefix length and a dotted mask.
  • Confirming a firewall rule's range covers what you intended.

How it works in practice

A worked example

A /26 has been handed to you for a new segment and you need the usable range before anything gets configured.

Input
IP address   10.0.5.130
Mask / CIDR  26
Output
NETWORK IP           10.0.5.128/26
BROADCAST IP         10.0.5.191
USABLE HOST RANGE    10.0.5.129 - 10.0.5.190
USABLE HOSTS         62
WILDCARD MASK        0.0.0.63
DOTTED SUBNET MASK   255.255.255.192
SUBNET CLASS & TYPE  CLASS A · PRIVATE (RFC 1918)

The address you typed is not the network. A /26 keeps twenty-six bits, so the last six identify the host and the network boundary falls every sixty-four addresses — which puts this one at .128 rather than at .130 or at .0. Everything else follows from those two numbers: the broadcast is the top of the block, the usable range is everything strictly between the two ends, and the wildcard is the mask inverted, which is the form access lists on Cisco equipment expect. The classification at the bottom is read from the address itself, not from the mask.

The edge case that catches people

Two prefixes break the subtract-two rule and the calculator will tell you so by reporting zero usable hosts. A /32 is a single address with no room for a network and a broadcast, which is how you write a host route. A /31 has exactly two addresses, both consumed by those roles under the classic arithmetic — and yet /31 links are standard practice on point-to-point circuits, where a standard permits both addresses to be used as hosts precisely because there is nobody else on the wire to broadcast to. Zero usable is arithmetically right and operationally misleading.

When not to use this tool

It answers a question about one block, and the questions that cause outages are about several. Nothing here can tell you whether the range you are about to configure already overlaps something in another site's plan, whether a summary route covers it, or whether the gateway convention on this network is the first host or the last. Address planning wants a register that every segment is recorded in; this is the tool for reading a prefix correctly once somebody has decided what it should be.

Frequently Asked Questions

What is a subnet?
A subnet (subnetwork) is a logical segment of a larger IP network. Subnetting splits a network into smaller isolated segments, improving security, reducing broadcast traffic, and allowing efficient IP address allocation.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation writes a network as IP/prefix — e.g. 192.168.1.0/24. The /24 means 24 bits are the network portion, leaving 8 bits (256 addresses) for hosts in that subnet.
What's the difference between network address and broadcast address?
The network address (first IP, e.g. 192.168.1.0) identifies the subnet and cannot be assigned to a host. The broadcast address (last IP, e.g. 192.168.1.255) sends to all hosts. Usable host addresses are everything in between.
How many usable hosts does a /24 subnet have?
A /24 has 256 addresses (2^8). Subtract 1 for the network address and 1 for the broadcast, giving 254 usable host IPs. General formula: 2^(32-prefix) - 2. For a /25: 128 - 2 = 126 usable hosts.
What's the difference between a private and public IP address?
Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are not routable on the public internet — used for internal networks. Public IPs are globally routable. Your router uses NAT to translate between them.

Common errors and gotchas

  • Counting the network and broadcast addresses as usable, which for IPv4 they are not.
  • Confusing a /24 with a /25, which halves the range and is easy to mistype.
  • Assuming a mask can have gaps, when a valid mask is a run of ones then zeros.
  • Applying IPv4 host-count arithmetic to IPv6, where the numbers and conventions differ.
  • Treating a /31 or /32 as unusable, when both have specific valid uses.

Related Developer Utilities tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate