GO KALI FREE

Network Intelligence

Subnet & CIDR Calculator

Free online Subnet & CIDR Calculator: calculate network address, broadcast IP, usable host range, wildcard mask, and binary subnet masks with instant Nmap scan command generation.

What Is a Subnet Calculator and CIDR?

A Subnet Calculator is an essential networking and cybersecurity utility that computes network boundaries, host capacity, broadcast addresses, and netmasks for any given IPv4 address and CIDR prefix. Classless Inter-Domain Routing (CIDR) replaced the legacy Class A, B, and C addressing scheme with variable-length prefix notation (e.g. /24, /16, /22). Calculating these boundaries accurately is vital for network segmentation, firewall ACL definitions, VPC planning, and scoping penetration tests.

For ethical hackers and security researchers, understanding CIDR notation is directly tied to target scoping and discovery scanning. Tools like Nmap, Masscan, and ZMap require network specifications in CIDR notation (such as 192.168.1.0/24 or 10.0.0.0/16). Knowing the exact first and last usable host IPs prevents out-of-scope scanning and ensures complete coverage of authorized targets.

This online Subnet Calculator operates entirely client-side inside your browser, ensuring maximum privacy and zero latency. It instantly calculates network addresses, broadcast IPs, usable host ranges, binary masks, wildcard masks, and even generates ready-to-use Nmap commands for network reconnaissance.

How IPv4 Subnetting Works

An IPv4 address consists of 32 bits divided into four 8-bit octets separated by dots. A subnet mask divides those 32 bits into two parts: network bits (represented by 1s) and host bits (represented by 0s). The CIDR prefix (e.g. /24) indicates the number of continuous 1s in the netmask.

To calculate the Network Address, a bitwise AND operation is performed between the 32-bit IP integer and the 32-bit subnet mask integer. The Broadcast Address is determined by a bitwise OR between the Network Address and the bitwise NOT of the subnet mask (the wildcard mask). The usable host range spans from Network Address + 1 to Broadcast Address - 1.

The total number of IP addresses in any subnet is 2^(32 - prefix). For traditional subnets (/30 and larger), 2 addresses are reserved for the network ID and broadcast address, leaving 2^(32 - prefix) - 2 usable host addresses. Special RFC 3021 subnets (/31) allow 2 usable hosts on point-to-point links, while /32 specifies a single host.

CIDR Prefix Reference Table

Different CIDR prefixes cater to different scales of network architecture. A /24 subnet provides 254 usable hosts (common for home LANs and branch offices). A /16 subnet provides 65,534 usable hosts (typical for corporate campuses or large cloud VPCs). A /8 subnet spans 16,777,214 addresses.

Micro-segmentation often leverages /27 (30 hosts), /28 (14 hosts), or /29 (6 hosts) for isolating database tiers, management interfaces, or DMZ jump hosts. Point-to-point router links typically use /30 (2 usable hosts) or /31.

In penetration testing, specifying the right CIDR block is critical. Running an aggressive Nmap service scan across an entire /16 takes hours and may crash intermediate routers, whereas targeting specific /24 or /27 subnets yields faster, more actionable reconnaissance data.

How to calculate IPv4 subnets and CIDR blocks

  1. 1
    Enter IPv4 address
    Type any IPv4 address (e.g. 192.168.1.100 or 10.0.0.1) into the input box.
  2. 2
    Select CIDR prefix
    Adjust the prefix slider or dropdown to select your subnet mask (from /0 to /32).
  3. 3
    Review calculated network values
    Inspect the network address, broadcast address, usable host range, and total host capacity.
  4. 4
    Copy Nmap scanning commands
    Switch to the Nmap tab to copy ready-to-run ping sweep and port scanning commands for the subnet.

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation represents an IP address and its subnet mask using a slash followed by the prefix length in bits (e.g., 192.168.1.0/24 indicates a 24-bit network mask of 255.255.255.0).

How many usable hosts are in a /24 subnet?

A /24 subnet contains 256 total IP addresses and 254 usable host addresses, because the first address (network ID) and last address (broadcast) cannot be assigned to hosts.

What is a wildcard mask?

A wildcard mask is the inverted counterpart of a subnet mask (calculated as 255.255.255.255 minus the subnet mask). For example, a /24 mask of 255.255.255.0 has a wildcard mask of 0.0.0.255, commonly used in Cisco ACLs and OSPF routing.

What are RFC 1918 private IP addresses?

RFC 1918 reserves three IPv4 blocks for private internal networks: 10.0.0.0/8 (10.0.0.0 - 10.255.255.255), 172.16.0.0/12 (172.16.0.0 - 172.31.255.255), and 192.168.0.0/16 (192.168.0.0 - 192.168.255.255). They are non-routable on the public internet.

How do penetration testers use subnet calculators?

Penetration testers use subnet calculators to determine the exact IP boundaries for authorized scanning, avoid out-of-scope IPs, and format target specifications for Nmap, Masscan, and vulnerability scanners.

Is this subnet calculator private?

Yes, 100% of the calculations run locally inside your web browser using JavaScript bitwise arithmetic. No IP addresses or queries are ever sent to any remote server.

Related Security Utilities

Network Intelligence

Safe Port Scanner

Scan common ports safely. Educational tool — shows open/closed ports and service names. No aggressive scanning.

Network Intelligence

IP Lookup

Look up IPv4 and IPv6 addresses to find ISP, country, city, region, ASN, and organization details.

Domain Intelligence

Domain Age Checker

Check domain creation date, calculate age in years/months/days, and show time until expiration.

Domain Intelligence

DNS Lookup

Query DNS records including A, AAAA, MX, TXT, NS, CNAME, and SOA records for any domain.

Related Cybersecurity Tutorials

OSINT · Intermediate

Nmap Advanced Techniques: Expert Network Scanning

Master advanced Nmap scanning techniques including NSE scripting, firewall evasion, performance tuning, and custom scan types for professional penetration testing.

Tools · Beginner

Nmap Beginner Tutorial: Mastering Network Scanning

Learn Nmap from scratch covering host discovery, port scanning, service detection, NSE scripts, and practical examples.

OSINT · Beginner

DNS Enumeration Guide: Complete Domain Reconnaissance

Master DNS enumeration techniques from basic queries to advanced zone transfers, subdomain brute forcing, and DNS security assessment using Kali Linux tools.

OSINT · Intermediate

DNS Enumeration: Uncovering Domain Infrastructure

Learn DNS enumeration techniques to discover domain infrastructure including record types, zone transfers, brute forcing, and DNS security extensions.