IP Subnet Calculator
Enter an IPv4 address with CIDR prefix (e.g., 192.168.1.0/24) to calculate
the network address, subnet mask, broadcast address, usable host range, and total hosts. Binary breakdown included.
Frequently Asked Questions
What is CIDR notation?▼
CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length to define a network range. For example, 192.168.1.0/24 means a network with a 24-bit subnet mask (255.255.255.0), giving 254 usable host addresses.
How do I calculate the number of usable hosts?▼
Usable hosts = 2^(32 - prefix) - 2. The -2 subtracts the network address (all host bits 0) and broadcast address (all host bits 1). For /24: 2^8 - 2 = 254. For /16: 2^16 - 2 = 65,534. For /30: 2^2 - 2 = 2 (common for point-to-point links).
What is a subnet mask?▼
A subnet mask is a 32-bit number that divides an IP address into network and host portions. /24 → 255.255.255.0, /16 → 255.255.0.0, /8 → 255.0.0.0. In binary, it's a contiguous block of 1s followed by 0s.
What is the difference between network address and broadcast address?▼
The network address (first address, all host bits = 0) identifies the subnet and cannot be assigned to a host. The broadcast address (last address, all host bits = 1) sends packets to all hosts on the subnet and also cannot be assigned.
What subnet should I use for a home/office network?▼
For small home networks, 192.168.1.0/24 (254 hosts) is standard. For medium offices, 10.0.0.0/22 (1022 hosts) or /23 (510 hosts) works well. For cloud VPCs, /16 gives room for multiple subnets. Reserve /28 or /30 for infrastructure point-to-point links.
How are private IP address ranges defined?▼
RFC 1918 defines three private ranges: 10.0.0.0/8 (Class A, ~16M addresses), 172.16.0.0/12 (Class B, ~1M addresses), and 192.168.0.0/16 (Class C, ~65K addresses). These are not routed on the public internet and require NAT to access external services.
Related Products
on GumroadDeveloper Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →Premium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →GitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →You Might Also Need
HTTP Security Headers Generator
Generate HTTP security headers configuration for nginx and Apache. Configure HSTS, CSP, X-Frame-Options, Referrer-Policy, and more with toggle switches. Copy ready-to-use configs.
Open free tool →
HTTP Security Headers Checker
Paste HTTP response headers and get a checklist of security headers present or missing. Checks CSP, HSTS, X-Frame-Options, and more.
Open free tool →
Content Security Policy Builder
Visual CSP builder with all directives. Generate Content-Security-Policy headers with source expressions, nonces, and report endpoints.
Open free tool →
More Free Tools
Related Articles
Zero Trust Security Architecture: Complete Implementation Guide for Developers
Learn how to implement Zero Trust security architecture in cloud-native applications. Covers IAM, micro-segmentation, OPA policy-as-code, mTLS with Istio, HashiCorp Vault, and SPIFFE/SPIRE with practical code examples.
SSH Key Generator Guide: Generate RSA and Ed25519 Keys for Secure Access
Learn how to generate SSH key pairs for GitHub, servers, and CI/CD pipelines. Comparison of RSA vs Ed25519, key sizes, passphrase best practices, and troubleshooting.
DevSecOps Tools Checklist 2026: 20 Essential Tools for Shift-Left Security
Complete DevSecOps tools checklist for 2026. 20 essential SAST, DAST, SCA, secrets scanning, and container security tools with free/open-source options.
Docker Compose vs Kubernetes for Small Teams 2026
Should small teams use Docker Compose or Kubernetes in 2026? Compare production viability, K3s as a middle ground, Kompose migration, and the real costs of managed Kubernetes for teams under 20.
Docker Compose vs Kubernetes: When to Use Each (2026)
A practical guide to choosing between Docker Compose and Kubernetes in 2026. Compare complexity, use cases, cost, and learn when to migrate from one to the other.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →