Security Tools

CIDR / Subnet Calculator

This free CIDR / Subnet Calculator turns any IPv4 address and prefix length (/0 to /32) into its network address, broadcast address, subnet mask, wildcard mask, usable host range and host counts, entirely in your browser. A /24 holds 256 addresses (254 usable hosts) and a /26 holds 64 (62 usable).

Tip: pasting a full block like 192.168.1.0/24 into the IP field splits it automatically.

Free IPv4 CIDR and Subnet Calculator

The Tools Kit's free CIDR / Subnet Calculator turns an IPv4 address and prefix length into everything you need to plan or check a subnet: the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total addresses and usable host count. Use it as an IP subnet calculator, a CIDR to subnet mask converter, or a quick way to see how many hosts fit in a /24, /26 or /29.

The math is plain bitwise arithmetic that runs in your browser, so the addresses you enter are not sent to a server. It works with IPv4 only, for prefixes from /0 to /32.

How to Use the CIDR Calculator

  1. 1

    Enter an IPv4 address

    Type any IPv4 address in the block, such as 192.168.1.0, or paste a full CIDR block like 192.168.1.0/24 and it splits into the address and prefix fields automatically.

  2. 2

    Set the CIDR prefix

    Enter the prefix length as a whole number from 0 to 32, for example 24 for a /24 network or 26 for a /26.

  3. 3

    Calculate

    Click Calculate or press Enter. The address does not have to be the network address; the calculator masks off the host bits for you.

  4. 4

    Read and copy the results

    See the network and broadcast addresses, subnet mask, wildcard mask, first and last usable host, total addresses, usable hosts and the binary netmask, then use Copy all to copy the eight result rows (everything except the binary netmask) as text.

An address with an octet above 255 or a prefix outside 0 to 32 is rejected with an error message instead of producing a misleading result.

How CIDR Subnet Calculation Works

An IPv4 address is 32 bits. In CIDR notation the number after the slash says how many of those bits belong to the network; the rest identify hosts. A /24 keeps 24 network bits and leaves 8 host bits, so it contains 28 = 256 addresses. If you want to see the bits themselves, the binary converter turns each octet into its 8-bit form.

  • Subnet mask = prefix-length 1 bits followed by 0 bits (/26 = 255.255.255.192)
  • Network address = IP address AND subnet mask
  • Broadcast address = network address OR wildcard mask
  • Total addresses = 2(32 − prefix)
  • Usable hosts = total − 2 (for /0 to /30)

Worked example: for 192.168.1.130/26 the mask is 255.255.255.192, so the last octet 130 (10000010 in binary) ANDed with 192 (11000000) gives 128. The network address is 192.168.1.128, the broadcast address is 192.168.1.191, and the 62 usable hosts run from 192.168.1.129 to 192.168.1.190.

Second example: 172.16.5.4/20 has the mask 255.255.240.0 and belongs to the network 172.16.0.0. Its broadcast address is 172.16.15.255, giving 4,096 total addresses and 4,094 usable hosts from 172.16.0.1 to 172.16.15.254.

CIDR to Subnet Mask Cheat Sheet

Common prefix lengths with their subnet masks and host counts, as the calculator reports them. Each step down in prefix length doubles the number of addresses.

PrefixSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

/31 and /32: The Special Cases

The usual rule of subtracting two reserved addresses breaks down at the smallest block sizes. A /31 has only two addresses, and point-to-point links between routers use both of them (RFC 3021), so the calculator reports 2 usable hosts with the first host equal to the network address and the last equal to the broadcast address. A /32 describes one single address, often used for a loopback interface or a host route, and is reported as 1 usable host. A /30, with 4 addresses and 2 usable hosts, is the smallest block that keeps separate network and broadcast addresses.

Common uses

  • Planning IP address allocation for a home lab, office LAN or VLAN
  • Checking how many devices a cloud VPC or subnet CIDR block can hold
  • Working out the wildcard mask for a router ACL or OSPF network statement
  • Verifying the usable host range before configuring a firewall, DHCP scope or static IPs
  • Studying for networking certifications and checking subnetting practice answers

Subnetting often sits next to other network checks. Find the public address your network uses with the IP checker, map an address in your range back to its hostname with a reverse DNS lookup, or test which services a host exposes with the port scanner. If a public IP in your block is having mail delivery problems, the blacklist checker shows whether it is listed, and the MAC address lookup helps identify an unknown device you found on the subnet. More network and security utilities are collected on the security tools page.

Subnetting terms explained

TermWhat it means here
CIDR notationAn IP address followed by a slash and a prefix length, such as 192.168.1.0/24, that describes a block of addresses
Prefix lengthThe number of leading bits (0 to 32 in IPv4) that identify the network; the remaining bits identify hosts
Subnet maskThe prefix written as a dotted-decimal address, such as 255.255.255.0 for /24
Wildcard maskThe inverse of the subnet mask, such as 0.0.0.255 for /24, used in router ACLs and OSPF statements
Network addressThe first address in the block, with all host bits set to 0; it identifies the subnet itself
Broadcast addressThe last address in the block, with all host bits set to 1; packets sent to it reach every host on the subnet
Usable host rangeThe addresses between the network and broadcast addresses that can be assigned to devices
Private range (RFC 1918)10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, reserved for internal networks and not routed on the public internet

Frequently Asked Questions

Reviewed by Raja Jahangir · Last reviewed: October 2026

How do you calculate a subnet from CIDR notation?

To calculate a subnet, enter an IPv4 address and a prefix length from 0 to 32, or paste a block like 192.168.1.0/24. The result shows the network address, broadcast address, subnet mask, wildcard mask, first and last usable host, and total addresses. A /24 holds 256 addresses, of which 254 are usable hosts.

How many usable hosts are in a /26 subnet?

A /26 subnet has 2 to the power of (32 minus 26), which is 64 addresses. Subtracting the network address and the broadcast address leaves 62 usable hosts, with a subnet mask of 255.255.255.192. For /31 and /32 blocks nothing is reserved, so a /31 point-to-point link has two usable addresses.

Runs in your browser. Your files and text never leave your device - nothing is uploaded.