Skip to content
DevToolKit

IPv4 Subnet Calculator

Visual 32-bit binary map, VLSM designer for optimal address allocation, and CIDR aggregation for route summarization.

IP Address / CIDR

Was this tool helpful?

How to Use

Calculate subnets, plan VLSMs, and aggregate CIDR blocks — all in your browser with zero external dependencies. Every calculation uses 32-bit unsigned integer arithmetic for instant results.

  1. Subnet Calculator: Enter an IP address in CIDR notation (e.g., 192.168.1.0/24). The tool instantly displays the network address, broadcast address, subnet mask, wildcard mask, usable host range, and a visual 32-bit binary map showing the network/host bit boundary.
  2. VLSM Designer: Enter a parent network and a list of subnet requirements (name + host count). The engine sorts subnets by size, allocates the smallest possible prefix for each, and reports efficiency.
  3. Supernet / Aggregate: Enter multiple CIDR blocks (one per line) to find the smallest encompassing supernet and an optimally aggregated CIDR list for routing summarization.
  4. CIDR Reference: A complete /0 through /32 reference table with subnet masks, wildcard masks, and address counts for quick lookup.

About This Tool

Subnet Masking Fundamentals

An IPv4 address is a 32-bit number split into a network portion and a host portion by the subnet mask. The CIDR prefix (e.g., /24) indicates how many of the 32 bits identify the network. A /24 subnet mask is 255.255.255.0 — the first 24 bits are network, leaving 8 bits (256 addresses, 254 usable hosts) for hosts. The network address has all host bits set to 0, the broadcast address has all host bits set to 1, and usable hosts occupy everything in between.

VLSM — Variable Length Subnet Masking

Traditional classful subnetting divides a network into equal-sized subnets, wasting addresses when departments need different sizes. VLSM solves this by allowing each subnet to have a different prefix length. A /24 network (256 addresses) can be split into a /26 (64 addresses) for the engineering team, a /27 (32 addresses) for sales, a /28 (16 addresses) for management, and a /30 (4 addresses) for a point-to-point server link — maximizing utilization.

Supernetting and Route Aggregation

Supernetting is the reverse of subnetting: it combines multiple smaller CIDR blocks into a single larger block. This is critical for reducing routing table size in BGP and OSPF. Four contiguous /24 networks (e.g., 10.0.0.0/24 through 10.0.3.0/24) can be summarized as a single /22 (10.0.0.0/22). The aggregation algorithm iteratively merges adjacent sibling blocks that share a common parent prefix until no more merges are possible.

Special Prefix Lengths

A /32 represents a single host route — no network or broadcast address. A /31 (RFC 3021) provides exactly 2 usable addresses for point-to-point links between routers, eliminating the traditional 2-address overhead. A /30 is the smallest traditional subnet with 2 usable hosts. A /0 represents the entire IPv4 address space (4.3 billion addresses) and is used as the default route in routing tables.

Why Use This Tool

Visual Binary Understanding

Most subnet calculators show results as raw numbers. Our visual 32-bit binary map color-codes every bit — network bits in your category accent color, host bits in gray — making the mask boundary immediately visible. Students and networking professionals can see exactly how the /24 boundary splits the third and fourth octets, or how a /20 cuts through the middle of the third octet. The bit map updates in real-time as you change the CIDR prefix.

Everything runs 100% client-side using pure JavaScript bitwise operations. No servers, no API calls, no tracking. Your network topology stays private.

FAQ

How do I calculate a subnet from an IP address and CIDR prefix?
Enter an IP address with a CIDR prefix (e.g., 192.168.1.0/24) and the calculator instantly shows the network address, broadcast address, subnet mask, wildcard mask, usable host range, and total addresses — all computed via 32-bit bitwise operations in your browser.
What is VLSM and how does the VLSM designer work?
Variable Length Subnet Masking (VLSM) allocates different-sized subnets within a single network to avoid wasting addresses. Enter a parent CIDR block and a list of subnet names with required host counts. The tool sorts them by size, assigns the smallest possible prefix for each, and reports allocation efficiency.
How does supernetting (CIDR aggregation) work?
Supernetting combines multiple smaller CIDR blocks into a single larger block. Enter multiple CIDR blocks and the calculator finds the smallest encompassing supernet plus an optimally aggregated list. This is commonly used to summarize routing table entries.
What do the colors in the binary bit map mean?
The 32-bit visual grid shows each bit of the IP address. Indigo-colored bits represent the network portion (determined by the CIDR prefix), while gray bits represent the host portion. The boundary between network and host bits is the subnet mask boundary.