Skip to main content

Free Subnet / CIDR Calculator

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

Works offline once loaded
/
/0/8/16/24/32
254
Usable hosts
256
Total addresses
Network address
Usable host range
Broadcast address
Subnet mask
Wildcard mask
Mask (binary)
IP class
Address type

Split into subnets

2 subnets of /25 with 126 usable hosts each

#NetworkUsable rangeBroadcast
1192.168.1.0/25192.168.1.1 – 192.168.1.126192.168.1.127
2192.168.1.128/25192.168.1.129 – 192.168.1.254192.168.1.255

IPv4 subnetting reference. /31 and /32 are handled per RFC 3021 (point-to-point and single-host). All math runs locally in your browser.

Common uses

  • Subnet Planning for Network AdminsPlan IP allocation, calculate usable hosts, and size subnets for your network.
  • Subnetting Practice for IT StudentsCheck your subnetting homework and CCNA practice problems instantly.
  • Home Lab & Self-Hosting SubnetsPlan IP ranges for your home network, VLANs, Docker, and self-hosted services.
  • Plan Cloud VPC CIDR BlocksSize AWS/GCP/Azure VPC and subnet CIDR ranges before you provision.
  • CIDR Ranges for Firewall RulesConvert IP ranges to CIDR notation for firewall allow/deny rules and ACLs.

How It Works

All calculations run entirely in your browser using hand-written bitwise arithmetic β€” no library, no server round-trip. You enter an IPv4 address and CIDR prefix length; the tool applies standard bit-masking operations directly in JavaScript to derive every subnet property instantly as you type.

  1. 1
    Input parsing and validation
    The tool splits the dotted-decimal IP address into four octets, validates each is 0–255, and packs them into a 32-bit unsigned integer using left-shift operations. Invalid addresses are caught before any calculation runs.
  2. 2
    Bitwise mask construction
    From the CIDR prefix length, a 32-bit subnet mask is built by left-shifting 0xFFFFFFFF by (32 βˆ’ prefix). Bitwise AND with the IP integer yields the network address; bitwise OR with the inverted mask yields the broadcast address. Total host count is computed as 2^(32 βˆ’ prefix).
  3. 3
    Class and RFC 1918 detection
    The first octet is compared against the class A/B/C/D/E boundary values to assign an IP class. A separate check tests whether the address falls within the 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, or 127.0.0.0/8 private ranges defined in RFC 1918.
  4. 4
    Subnet splitting and shareable state
    The subnet splitter divides the current network into equal child subnets at a chosen longer prefix: it steps through integer offsets of 2^(32 βˆ’ new prefix) from the base address, computing each child's network, broadcast, and usable range on the fly. The current IP and prefix are written to the URL hash so results can be bookmarked or shared.

Related Tools

Frequently Asked Questions