Free Subnet / CIDR Calculator
Calculate network address, broadcast, usable host range, subnet mask, and host count from any IPv4 address and CIDR prefix.
Split into subnets
2 subnets of /25 with 126 usable hosts each
| # | Network | Usable range | Broadcast |
|---|---|---|---|
| 1 | 192.168.1.0/25 | 192.168.1.1 β 192.168.1.126 | 192.168.1.127 |
| 2 | 192.168.1.128/25 | 192.168.1.129 β 192.168.1.254 | 192.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.
- 1Input parsing and validationThe 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.
- 2Bitwise mask constructionFrom 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).
- 3Class and RFC 1918 detectionThe 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.
- 4Subnet splitting and shareable stateThe 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
QR Code Generator
Generate QR codes for URLs, text, WiFi, and more. No watermark.
Color Picker & Palette Generator
Pick colors, convert between HEX/RGB/HSL, and generate harmonious palettes.
Password Generator
Generate strong, random passwords with custom length, character types, and exclusions. Free, no login.