CIDR & Subnet Calculator Online — IPv4/IPv6 Subnetting & Visual Bitmask

CIDR & Subnet Calculator

Calculate IPv4/IPv6 subnets, network/broadcast addresses, usable IP ranges, wildcard masks, and visual bitwise subnet splitting.

Free online CIDR and subnet calculator for DevOps engineers, cloud architects, and software developers. Enter any IPv4 or IPv6 CIDR block, IP/subnet mask pair, or IP/wildcard pair to instantly calculate network address, broadcast address, first and last usable host IPs, total hosts, usable hosts (with AWS 5-reserved IP comparison), IP class, RFC scope, integer/hex representations, and reverse DNS zones (in-addr.arpa / ip6.arpa). Features an interactive 32-bit visual bitmask diagram, subnet splitter table with CSV/Markdown export, cloud VPC presets (AWS 3-tier VPC, GCP, Azure VNet, Kubernetes), and batch IP containment checking.

Keywords: cidr calculator, subnet calculator, ip range calculator, ipv6 subnet calculator, cidr subnet calculator, ip subnet mask calculator, visual subnet calculator, cidr notation calculator, ipv4 cidr calculator, ipv6 cidr calculator, subnet splitter, subnet mask to cidr, wildcard mask calculator, aws vpc subnet calculator, cloud subnet calculator, usable ip calculator, network address calculator, broadcast address calculator, ip containment checker, subnet overlap checker, bitwise subnet calculator

Tags: cidr, subnet, subnetting, ipv4, ipv6, networking, netmask, wildcard, ip-range, vpc, aws, kubernetes, devops

Browse all 13 Network tools →

How to CIDR & Subnet Calculator Online

  1. Enter an IPv4 or IPv6 CIDR block (e.g. 10.0.0.0/16, 192.168.1.0/24, or 2001:db8::/32), or switch input mode to IP + Subnet Mask (e.g. 192.168.1.1 with 255.255.255.0) or IP + Wildcard Mask (e.g. 10.0.0.1 with 0.0.255.255).

  2. Select a Cloud Architecture Preset from the presets dropdown (AWS 3-Tier VPC, Google Cloud Auto VPC, Azure VNet, Kubernetes Pod CIDR, or Docker Bridge) to load production-grade networking configurations with a single click.

  3. Use the interactive Prefix Length Slider (/0 to /32 for IPv4, /0 to /128 for IPv6) to dynamically adjust subnet boundaries and instantly see recalculations without reloading the page.

  4. Toggle between Standard Host Mode (RFC 2^N - 2) and AWS Cloud Mode (2^N - 5) to inspect the 5 reserved IP addresses (.0 network, .1 VPC router, .2 DNS, .3 future, .255 broadcast) required for cloud infrastructure planning.

  5. Click the Visual Bitmask tab to inspect the 32-bit octet breakdown with color-coded network, subnet, and host bits, and click any individual bit to adjust the prefix length directly.

  6. Switch to the Subnet Slicer tab to partition your parent CIDR block into smaller subnets (such as slicing a /16 into /24s or /20s), and export the generated subnet table as CSV, Markdown, or a plain text CIDR list.

  7. Open the Containment & Overlap tab to test batch IP addresses against your subnet or verify if two CIDR blocks collide before provisioning VPC peering connections or configuring firewall rules.

  8. Copy individual fields with one click, export the full structured JSON payload (⌘⇧C), or share your calculation via URL parameters.

CIDR & Subnet Calculator Features

  • Dual IPv4 and IPv6 Bitwise Engine: Performs high-performance, accurate bitwise arithmetic in pure TypeScript with zero external server dependencies.

  • Flexible Input Modes: Calculate subnets using standard CIDR slash notation (/N), IPv4 IP + Dotted Subnet Mask (e.g. 255.255.255.0), or IPv4 IP + Cisco-style Wildcard Mask (e.g. 0.0.0.255).

  • Interactive 32-Bit Octet Bitmask Map: Visualizes 32 binary bits divided across 4 octets, color-coding Classful Network bits, Subnet bits, and Host bits with click-to-resize prefix functionality.

  • Real-Time Prefix Length Slider: Smoothly drag between /0 (Default Route) and /32 (Single Host) for IPv4, or /0 and /128 for IPv6, with live host counts and boundary updates.

  • Cloud VPC Mode (AWS 5-Reserved IPs): Calculates usable host counts accounting for the 5 addresses reserved by Amazon VPC in every subnet block (.0, .1, .2, .3, and .255).

  • Pre-Configured Architecture Presets: Includes one-click presets for AWS 3-Tier Production VPCs (/16), GCP Auto VPCs (/20), Azure VNets (/16), Kubernetes Pod and Service CIDRs, Docker Bridge networks, and Private Office LANs.

  • Interactive Subnet Slicer & Table: Divide any parent CIDR block into child subnets (e.g., /16 into 256 /24s) with live filtering, pagination, and multi-format export options.

  • Multi-Format Export: Export subnetting plans to CSV spreadsheet files, GitHub-flavored Markdown tables, or newline-delimited CIDR lists.

  • Batch IP Containment Testing: Paste single or multi-line IP address lists to instantly check whether each IP falls within the calculated subnet range.

  • Subnet Overlap & Collision Detector: Analyze whether two CIDR blocks overlap, are identical, contain one another, or are completely disjoint for VPC peering and routing table safety.

  • Comprehensive Network Metadata: Calculates IP Class (A, B, C, D, E), RFC Scope (RFC 1918 Private, RFC 6598 CGNAT, Loopback, Link-Local, Public), integer and hex representations, and reverse DNS PTR zones (in-addr.arpa / ip6.arpa).

  • RFC Standards Compliance: Full support for RFC 3021 (/31 point-to-point subnets with 2 usable hosts), RFC 1122 (/32 host routes), RFC 4291 IPv6 addressing, and RFC 5952 IPv6 canonical representation.

  • URL State Synchronization: Saves the current CIDR block and active tab in the browser URL for easy bookmarking and team sharing.

  • 100% Client-Side Privacy Guarantee: All calculations and IP inputs are processed locally in your browser with zero telemetry or server-side logging.

  • REST API Endpoint: Programmatically calculate CIDR subnets, slice subnets, check containment, and detect overlaps via the `/api/tools/cidr-calculator` JSON endpoint.

  • Keyboard Shortcuts: Boost productivity with ⌘↵ (Calculate), ⌘⇧C (Copy JSON), and ⌘⇧K (Reset).

Supported SQL Dialects

The CIDR & Subnet Calculator supports 6 SQL dialects. Select the right dialect for accurate formatting and keyword recognition.

IPv4 CIDR (Classless Inter-Domain Routing)
Standard 32-bit IPv4 addressing replacing legacy Class A/B/C boundaries with variable-length subnet masks (VLSM) from /0 to /32.
IPv6 Subnetting (RFC 4291 / RFC 5952)
128-bit hexadecimal addressing structured around standard /64 interface boundaries, /48 organizational allocations, and canonical zero compression.
AWS Virtual Private Cloud (VPC)
Amazon Web Services cloud network model reserving 5 IP addresses per subnet (.0 network, .1 VPC router, .2 DNS, .3 future, .255 broadcast).
Google Cloud Platform (GCP) VPC
Google Cloud Andromeda SDN model featuring global virtual networks with regional subnets (default auto mode /20, custom /8 to /29).
Microsoft Azure Virtual Network (VNet)
Azure software-defined networking utilizing CIDR blocks /8 to /29 with specialized subnets like GatewaySubnet (/27) and AzureFirewallSubnet (/26).
Kubernetes CNI & Cluster CIDR
Container Network Interface architectures partitioning Pod CIDR blocks (/16 per cluster, /24 per node) and Service ClusterIP CIDRs (/12 or /16).

Frequently Asked Questions

What is CIDR notation and how does it work?
CIDR (Classless Inter-Domain Routing) notation is the standard method for specifying IP addresses and their associated routing prefixes. It consists of an IP address followed by a slash (/) and a prefix length number (e.g. 192.168.1.0/24 or 10.0.0.0/16). The prefix number specifies how many contiguous leading bits represent the Network Address, leaving the remaining bits (32 - N for IPv4, 128 - N for IPv6) for individual Host Identifiers. CIDR replaced the rigid 1980s classful networking system (Class A, B, and C) to allow efficient, variable-length subnet allocation (VLSM).
How do you calculate the total and usable IP addresses in a subnet?
In IPv4, the total number of IP addresses in a /N subnet is calculated using the formula 2^(32 - N). The number of standard usable host addresses is 2^(32 - N) - 2 because two addresses are permanently reserved: the lowest address is the Network ID (used to identify the subnet wire), and the highest address is the Subnet Broadcast Address (used to send packets to all hosts on the subnet). For example, a /24 subnet has 2^(32 - 24) = 256 total IP addresses and 254 usable host addresses (192.168.1.1 through 192.168.1.254).
Why does AWS reserve 5 IP addresses in every VPC subnet?
Amazon Web Services (AWS) reserves the first 4 IP addresses and the last 1 IP address in every VPC subnet block regardless of size: (1) .0 is the Network Address; (2) .1 is reserved by AWS for the VPC router default gateway; (3) .2 is reserved by AWS for the AmazonProvidedDNS resolver; (4) .3 is reserved by AWS for internal future use; and (5) .255 (or the last IP address in the subnet) is the Network Broadcast Address. Consequently, for AWS subnets, usable host capacity is calculated as 2^(32 - N) - 5. For example, an AWS /24 subnet provides 251 usable IP addresses instead of the standard 254.
What is RFC 3021 and why are /31 subnets used for point-to-point links?
RFC 3021 (Using 31-Bit Prefixes on IPv4 Point-to-Point Links) standardizes using /31 subnets for direct router-to-router connections. Because a point-to-point link has exactly two endpoints and no third party, dedicated network and broadcast addresses are unnecessary. Both IP addresses in a /31 block are treated as valid host addresses. This practice conserves 50% of the IP addresses compared to legacy /30 subnets (which allocated 4 IPs to gain only 2 usable hosts).
What are the RFC 1918 private IPv4 address ranges?
RFC 1918 defines three private IPv4 address spaces that are reserved for internal enterprise and local networks and cannot be routed across the public internet: (1) 10.0.0.0/8 (10.0.0.0 - 10.255.255.255, providing 16,777,216 total addresses, commonly used for enterprise cloud VPCs); (2) 172.16.0.0/12 (172.16.0.0 - 172.31.255.255, providing 1,048,576 addresses, used in Docker bridges and mid-size networks); and (3) 192.168.0.0/16 (192.168.0.0 - 192.168.255.255, providing 65,536 addresses, standard for home and small office Wi-Fi routers).
What is the difference between RFC 1918 Private IPs and RFC 6598 CGNAT?
RFC 1918 addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are private IPs managed within an organization's internal network. RFC 6598 defines the 100.64.0.0/10 block (100.64.0.0 - 100.127.255.255) specifically for Carrier-Grade NAT (CGNAT) used by Internet Service Providers (ISPs) and cloud providers (such as Kubernetes Tailscale/WireGuard overlays or AWS Carrier Gateways) to multiplex multiple customers through shared public IPv4 addresses without colliding with customer RFC 1918 local subnets.
How does IPv6 subnetting work compared to IPv4?
IPv6 addresses are 128 bits long (written as 8 hexadecimal fields separated by colons). Unlike IPv4 where subnet sizes vary widely to conserve scarce addresses, IPv6 standardizes virtually all local subnets at /64 (leaving 64 bits for host interface identifiers, yielding 2^64 or 18.4 quintillion addresses per subnet). Internet Service Providers typically assign a /48 or /56 global prefix to organizations or homes, which can be easily partitioned into 65,536 or 256 individual /64 subnets without complex bit calculations.
What is the difference between a Subnet Mask and a Wildcard Mask?
A Subnet Mask uses contiguous binary 1s to identify the network portion and 0s for the host portion (e.g., 255.255.255.0 in decimal, or 11111111.11111111.11111111.00000000 in binary). A Wildcard Mask (also called an inverse mask) is the bitwise complement (bitwise NOT) of the subnet mask, where 0s represent bits that must match and 1s represent "don't care" bits (e.g., 0.0.0.255 in decimal, or 00000000.00000000.00000000.11111111 in binary). Wildcard masks are predominantly used in Cisco IOS Access Control Lists (ACLs) and OSPF routing protocols.
How does the Subnet Slicer / Splitter tool work?
The Subnet Slicer mathematically subdivides a parent CIDR block into smaller equal-sized subnets. If you have a parent /16 network (such as 10.0.0.0/16) and choose a target prefix of /24, the tool calculates 2^(24 - 16) = 2^8 = 256 individual /24 subnets (10.0.0.0/24, 10.0.1.0/24, ..., 10.0.255.0/24). For each child subnet, it computes the network address, broadcast address, first usable IP, last usable IP, and total host capacity, enabling instant export to CSV or Markdown for architecture planning.
What is Subnet Overlap and why is it dangerous?
Subnet Overlap occurs when two distinct network segments have intersecting IP address ranges (for example, assigning 10.0.0.0/16 to VPC A and 10.0.4.0/24 to VPC B). When overlapping networks attempt to communicate via VPN tunnels, AWS VPC Peering, Direct Connect, or Kubernetes cluster meshes, router forwarding tables experience routing ambiguity, packet drops, and asymmetric routing failures. Our Subnet Overlap Detector helps you verify whether CIDR blocks collide before deploying infrastructure.
How do reverse DNS PTR zones (in-addr.arpa and ip6.arpa) work?
Reverse DNS resolves an IP address back to its fully qualified domain name (FQDN) using PTR (Pointer) records in specialized DNS root domains. For IPv4, the octets are reversed and appended to `.in-addr.arpa` (for example, IP 192.168.1.50 has PTR record `50.1.168.192.in-addr.arpa`). For IPv6, each individual 4-bit hexadecimal nibble is separated by dots in reverse order and appended to `.ip6.arpa`. Our calculator generates the correct reverse DNS delegation zone for any subnet block.
What are the recommended subnet sizes for Kubernetes clusters?
In Kubernetes cluster design, separate CIDR blocks are allocated for Pods, Services, and Node infrastructure. Standard CNI plugins (like Calico, Cilium, and Flannel) assign a /16 Pod CIDR (e.g. 10.244.0.0/16), which is automatically sliced into a /24 subnet (254 pod IPs) per worker node. Service ClusterIPs are typically assigned a separate non-overlapping CIDR such as 10.96.0.0/12 (providing over 1 million internal service virtual IPs).
Can I test whether a specific IP address is included in a CIDR block?
Yes. The Containment & Overlap tab features a Batch IP Containment Checker where you can paste one or dozens of IP addresses. The tool performs bitwise masking to verify whether each IP address matches the network ID and falls inside the subnet boundaries, providing clear visual pass/fail badges.
Is my network configuration or IP data kept private?
Yes, completely. This CIDR and subnet calculator runs 100% client-side in your browser using local JavaScript/TypeScript bitwise arithmetic. No IP addresses, CIDR blocks, or network architectures are ever transmitted to our servers or logged to any database.
Can I use this CIDR calculator via an API in scripts or CI/CD pipelines?
Yes. You can send GET or POST requests to `/api/tools/cidr-calculator` with JSON parameters (`{ "input": "10.0.0.0/16", "action": "calculate" | "slice" | "containment" | "overlap" }`) to receive structured JSON responses for automated Terraform scripts, Ansible playbooks, and CI/CD validation gates.

Developer Reference & Learning Hubs