IPv4 Subnet Mask & CIDR Notation Calculator

IPv4 Subnet Mask & CIDR Notation Calculator

Compute IPv4 network address, broadcast, usable host ranges, and wildcard masks from CIDR notation.

/1/8/16/24/32
IPv4 Subnet Topology Client-Side Execution
Network Address192.168.1.0/24Subnet Mask: 255.255.255.0
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Broadcast Address192.168.1.255
Usable Hosts254

At a Glance

Category
Networking & DevOps Utilities
Best For
Network engineers, cloud architects (AWS/Azure/GCP), DevOps professionals, and system administrators
Privacy
100% in your browser: nothing you enter is uploaded
Time Required
Under a minute
Cost
Free Forever
Updated
November 2026

Quick Overview

What This Tool Does

The IPv4 Subnet Mask & CIDR Calculator is a high-precision networking utility that performs 32-bit bitwise arithmetic on IPv4 addresses and prefix masks. It computes subnet masks, wildcard masks, network addresses, broadcast addresses, and usable host address ranges in real time.

Who Should Use It

Cloud infrastructure engineers configuring VPCs and subnets, network administrators provisioning VLANs, DevOps teams allocating Kubernetes pod CIDRs, and systems engineers securing firewalls.

When to Use It

Use this calculator when designing cloud networking topologies, provisioning AWS VPCs, configuring router access control lists (ACLs), or partitioning corporate IP ranges.

Why It Is Useful

Overlapping subnets or miscalculated CIDR blocks lead to catastrophic IP exhaustion, routing table loops, and broken inter-service communication. Deterministic bitwise calculation eliminates manual binary math mistakes.

Key Features & Capabilities

Complete /0 to /32 CIDR Support

Covers the entire spectrum from massive global /8 networks down to point-to-point /30 and host-specific /32 routes.

Deterministic Bitwise Precision

Implements bitwise shift and mask operations ((ipInt & maskInt) >>> 0) to guarantee mathematical accuracy.

Usable Host Capacity Quantification

Automatically calculates total addresses (2^(32-CIDR)) and usable hosts (subtracting network and broadcast IPs).

Full Privacy Architecture

Calculates all network topologies locally in browser memory without sending private IP addresses over the web.

How to Use This Tool

1

Enter Target IPv4 Address

Input any valid dotted-decimal IPv4 address (e.g., 10.0.15.50 or 192.168.1.100). Tip: Each octet must be an integer between 0 and 255 separated by periods.

2

Select CIDR Prefix Length

Choose your network mask prefix from /0 down to /32 using the dropdown menu or slider. Tip: A /24 prefix provides 254 usable hosts and represents a standard class C subnet (255.255.255.0).

3

Analyze Subnet Metrics

Review the calculated Subnet Mask, Network Address, Broadcast Address, and Usable Host Range. Tip: Verify that the first and last usable host addresses fit within your server allocation plan.

4

Export Parameters to Cloud Config

Copy the derived CIDR string, gateway IP, or netmask into your Terraform, AWS VPC, or router config. Tip: Remember that cloud providers like AWS reserve the first 4 and last 1 IP addresses in every VPC subnet.

Worked Transformation Example

Calculating Network and Broadcast Addresses via 32-Bit Bitwise Math

A DevOps engineer computes network boundaries for a 192.168.1.100/24 node.

Sample Inputs
Input Payloadconst parts = "192.168.1.100".split(".").map(Number); const ipInt = (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3]; const maskInt = (~0 << (32 - 24)) >>> 0; const networkInt = (ipInt & maskInt) >>> 0; const broadcastInt = (networkInt | (~maskInt >>> 0)) >>> 0;
Transformed Outputconsole.log("Network:", (networkInt >>> 24) + "." + ((networkInt >> 16) & 255) + "." + ((networkInt >> 8) & 255) + "." + (networkInt & 255)); // Network: 192.168.1.0
Calculation Breakdown
Uses bitwise shift and AND operations to isolate network bits and OR operations with inverted mask for broadcast.
Specification: RFC 4632 (Classless Inter-domain Routing: The Internet Address Assignment and Aggregation Plan)

Technical Specification & Algorithm

Performs 32-bit unsigned bitwise manipulation on dotted-decimal IPv4 strings to compute subnet masks, network addresses, broadcast boundaries, and host allocations conforming to RFC 4632.. Zero external network requests, analytics beacons, or server telemetry dispatched. Executed in 100% Client-Side Web Browser JavaScript Engine (V8 / WebKit / SpiderMonkey).

Formula / AlgorithmRFC 4632 (Classless Inter-domain Routing: The Internet Address Assignment and Aggregation Plan)
const parts = "192.168.1.100".split(".").map(Number);
const ipInt = (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3];
const maskInt = (~0 << (32 - 24)) >>> 0;
const networkInt = (ipInt & maskInt) >>> 0;
const broadcastInt = (networkInt | (~maskInt >>> 0)) >>> 0;

Frequently Asked Questions

Why are there only 254 usable hosts in a /24 subnet instead of 256?
The first address (.0) is reserved as the Network Identifier, and the last address (.255) is reserved as the Broadcast Address. 256 - 2 = 254 usable hosts.
What is the subnet mask equivalent of a /16 CIDR block?
A /16 prefix corresponds to a subnet mask of 255.255.0.0, providing 65,536 total IP addresses and 65,534 usable host addresses.
Can I use this tool to calculate private RFC 1918 subnets?
Yes. It works identically for all IPv4 ranges, including 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and public routable IPs.
Does this calculator transmit my internal network topology to any external server?
No. All calculations are performed strictly inside your browser memory using client-side JavaScript bitwise operators.

Complementary QuickForma Utilities