IP Subnet Calculator - CIDR, Hosts & Network Range
No data stored • Instant calculations
Calculate network ranges, usable hosts, and subnet masks from any CIDR notation. Supports IPv4 (/0-/32) and IPv6 (/0-/128) with visual binary breakdown.
Free CIDR & Network Calculator
Enter a CIDR address above to get started
We'll calculate network range, usable hosts, and more
Calculate Subnets for Network Planning & VLSM Design
A subnet calculator determines network boundaries from IP addresses and CIDR notation. Enter any IPv4 or IPv6 address with prefix length, and instantly see the network address, broadcast address, usable host range, subnet mask, and wildcard mask—all in multiple formats including binary and hexadecimal.
What You'll Discover
Can Find
- Network address and broadcast address
- Subnet mask in decimal, binary, and hex formats
- Wildcard mask for ACL configuration
- Total addresses and usable host count
- First and last usable IP addresses
- IP class and private/public classification
- Visual binary breakdown of network/host bits
Cannot Find
- IP geolocation or ISP information (use IP Lookup)
- Live network status or connectivity
- DNS records or hostname resolution
- Which specific IPs are in use on your network
How to Calculate Any Subnet
Three input modes for different workflows
Choose Your Input Mode
Select CIDR notation (192.168.1.0/24), IP + Subnet Mask dropdown (25 options from /8 to /32), or IP + Required Hosts (enter how many hosts you need).
Enter Your IP Address
Type an IPv4 address (like 192.168.1.0) or IPv6 address (like 2001:db8::) with the appropriate prefix length or mask selection.
View Network Details
See network address, broadcast address, subnet mask, wildcard mask, and usable host range. Toggle binary view to see network/host bit separation.
Split Subnets (Optional)
Use the built-in subnet splitter to divide your network into 2, 4, 8, 16, 32, or 64 smaller subnets for VLSM design.
Export Results
Download results as JSON (for APIs), CSV (for spreadsheets), or plain text (for documentation). Copy individual values with one click.
Understanding Your Subnet Calculator Results
What each calculated value means and how to use it
Network Address
The first address in your subnet, identifying the network itself. This address cannot be assigned to any device—it's reserved for routing purposes. For 192.168.1.0/24, the network address is 192.168.1.0.
192.168.1.0
Broadcast Address
The last address in your subnet, used to send data to ALL hosts on the network simultaneously. Like the network address, it cannot be assigned to devices. For 192.168.1.0/24, the broadcast is 192.168.1.255.
192.168.1.255
Subnet Mask
Defines the boundary between network bits and host bits. Shown in four formats: dotted decimal (255.255.255.0), CIDR notation (/24), binary (11111111.11111111.11111111.00000000), and hexadecimal (FF.FF.FF.00).
255.255.255.0 = /24
Wildcard Mask
The inverse of the subnet mask, used in access control lists (ACLs) and routing protocols like OSPF. Where subnet mask has 1s, wildcard has 0s. For /24: subnet mask 255.255.255.0 → wildcard 0.0.0.255.
0.0.0.255
Usable Hosts
The number of IP addresses available for devices. Calculated as 2^(host bits) - 2, subtracting network and broadcast addresses. A /24 has 256 total addresses but only 254 usable hosts. Exception: /31 has 2 usable (point-to-point), /32 has 1.
254 hosts for /24
First & Last Usable Host
The IP address range you can actually assign to devices. First usable is network address + 1, last usable is broadcast - 1. For 192.168.1.0/24: first is .1, last is .254.
192.168.1.1 - 192.168.1.254
IP Classification
Shows the legacy IP class (A/B/C/D/E based on first octet) and whether the address is private (10.x, 172.16-31.x, 192.168.x) or public (internet-routable). While CIDR replaced classful networking, these terms are still widely referenced.
Class C, Private
Binary Breakdown
Visual representation showing which bits belong to the network portion (highlighted) and which are available for hosts. Essential for understanding subnetting concepts and useful for CCNA/Network+ study.
11000000.10101000.00000001|.00000000
Why Use Our Subnet Calculator
Unique capabilities that set us apart from other calculators
3 Flexible Input Modes
Enter CIDR notation directly, select from 25 preset subnet masks in a dropdown, or specify how many hosts you need and we'll calculate the optimal subnet size.
Visual Binary Breakdown
See network and host bits color-coded in a visual display. Perfect for learning subnetting concepts or verifying calculations during CCNA/Network+ study.
Built-in Subnet Splitter
Divide any subnet into 2, 4, 8, 16, 32, or 64 smaller subnets with one click. Essential for VLSM design without needing a separate tool.
Full IPv6 Support
Calculate IPv6 subnets from /0 to /128. See compressed and exploded notation, address type (Global Unicast, Link-Local, Unique Local), and total addresses.
Multiple Output Formats
Every mask shown in decimal, binary, and hexadecimal. Export complete results as JSON, CSV, or plain text for documentation and scripting.
Instant RFC-Compliant Results
Calculations use Python's ipaddress module—the same RFC-compliant library used in production network tools. Results in milliseconds, cached for 24 hours.
When You Need Subnet Calculations
Common scenarios where this tool helps
Network Planning & Design
Planning a new network? Determine how many subnets you need and how many hosts each can support. Enter your required host count to find the optimal prefix length, then use the subnet splitter to allocate address space efficiently.
Router & Firewall Configuration
Get the exact network address, subnet mask, and wildcard mask for configuring routers, switches, and firewalls. Copy values directly to your configuration files without manual conversion errors.
CCNA & Network+ Study
Understand subnetting concepts with our visual binary breakdown. See exactly which bits are network vs host, verify your manual calculations, and build intuition for subnet boundaries.
Network Troubleshooting
Verify if two IP addresses are on the same subnet. Debug connectivity issues by checking that devices have consistent network addresses and aren't accidentally on different subnets.
VLSM Design & Optimization
Design variable-length subnet schemes for efficient IP utilization. Use the subnet splitter to create different-sized subnets from a single block—allocate a /26 for servers, /28 for management, and /27 for users.
ACL & OSPF Configuration
Calculate wildcard masks for access control lists and OSPF routing. Our calculator shows wildcard in decimal, binary, and hex—copy directly to your Cisco, Juniper, or other network device configs.
How Subnet Calculations Work
Calculation Method
We use Python's ipaddress module, the same RFC-compliant library used in production networking tools. The network address is calculated using a bitwise AND operation between the IP and subnet mask. The broadcast address is found by setting all host bits to 1. This ensures mathematically correct results for any valid input.
IPv4 vs IPv6 Subnetting
IPv4 uses 32-bit addresses with prefix lengths from /0 to /32. Common prefixes include /8 (Class A, 16M hosts), /16 (Class B, 65K hosts), /24 (Class C, 254 hosts), and /30 (point-to-point, 2 hosts). IPv6 uses 128-bit addresses with typical allocations of /48 for sites, /64 for individual subnets, and /128 for single hosts. IPv6 doesn't reserve network/broadcast addresses the same way.
Binary Mathematics Explained
Subnetting is fundamentally binary math. The subnet mask creates a boundary: bits set to 1 identify the network, bits set to 0 are available for hosts. Our visual breakdown shows this clearly—network bits in one color, host bits in another. For /24, that's 24 network bits (first 3 octets) and 8 host bits (last octet), giving 2^8 = 256 addresses.
Special Subnet Cases
/32 represents a single host—used for loopback addresses or host routes. /31 (RFC 3021) provides exactly 2 addresses for point-to-point links between routers, with no network or broadcast address wasted. /30 is the traditional point-to-point choice with 4 addresses (2 usable). Our calculator handles all these cases correctly.
Technical Specifications
- Calculation Engine
- Python ipaddress module (RFC-compliant)
- IPv4 Support
- /0 to /32 prefix lengths
- IPv6 Support
- /0 to /128 prefix lengths
- Input Modes
- CIDR, IP+Mask (25 options), IP+Hosts
- Subnet Splitter
- 2, 4, 8, 16, 32, or 64 subnets
- Output Formats
- Decimal, Binary, Hexadecimal
- Export Options
- JSON, CSV, Plain Text
- API Access
- Free REST API (4 endpoints)
- Cache Duration
- 24 hours (deterministic results)
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length, like 192.168.1.0/24. The number after the slash indicates how many bits identify the network—24 bits means the first 3 octets are the network portion, leaving 8 bits (256 addresses) for hosts.
What's the difference between network and broadcast address?
The network address is the first address in a subnet, identifying the network itself (like 192.168.1.0). The broadcast address is the last address, used to send data to all hosts (like 192.168.1.255). Neither can be assigned to devices—that's why usable hosts is always 2 less than total addresses.
How do I calculate usable hosts in a subnet?
Usable hosts = 2^(32 - prefix) - 2 for IPv4. You subtract 2 for the network and broadcast addresses. For a /24: 2^(32-24) - 2 = 2^8 - 2 = 256 - 2 = 254 usable hosts. Exception: /31 has 2 usable (no addresses reserved), /32 has 1.
What is a wildcard mask and when do I need it?
A wildcard mask is the inverse of a subnet mask, used in ACLs (access control lists) and routing protocols like OSPF. Where the subnet mask has 1s, the wildcard has 0s. For /24: subnet mask 255.255.255.0 becomes wildcard 0.0.0.255. Cisco and many network devices require wildcard masks for matching IP ranges.
What are IP address classes (A, B, C)?
Legacy classful networking divided IPs by their first octet: Class A (1-126, /8 default), Class B (128-191, /16 default), Class C (192-223, /24 default), Class D (224-239, multicast), Class E (240-255, reserved). CIDR replaced this rigid system, but the terms are still widely used.
What's special about /31 and /32 subnets?
A /32 represents a single IP address—used for host routes or loopback interfaces. A /31 (RFC 3021) provides exactly 2 addresses for point-to-point links, with neither reserved for network/broadcast. This saves IP space compared to /30, which wastes 2 of its 4 addresses.
Can I calculate from the number of hosts I need?
Yes! Use the 'IP + Required Hosts' input mode. Enter an IP address and how many hosts you need, and we'll calculate the smallest subnet that fits. Need 50 hosts? You'll get a /26 (62 usable). Need 200? You'll get a /24 (254 usable).
Does this calculator support IPv6?
Yes, fully. Enter any IPv6 address with prefix length (like 2001:db8::/32) and we'll calculate the network range, total addresses, and address type (Global Unicast, Link-Local, or Unique Local). IPv6 uses 128-bit addresses with prefixes from /0 to /128.
How does the subnet splitter work?
After calculating a subnet, use the splitter to divide it into smaller networks. Select 2, 4, 8, 16, 32, or 64 subnets, and we'll show the new prefix length, hosts per subnet, and a table with each subnet's network, first host, last host, and broadcast addresses.
What are private vs public IP addresses?
Private IPs (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are for internal networks and can't be routed on the internet. Public IPs are globally unique and internet-routable. Our calculator shows which type your subnet is—important for network planning and NAT configuration.
Can I export the calculation results?
Yes! After calculating, download results as JSON (for APIs and scripts), CSV (for spreadsheets), or plain text (for documentation). Each field also has a copy button for quick one-click copying.
What is VLSM and how does this help?
Variable Length Subnet Masking (VLSM) lets you divide a network into subnets of different sizes for efficient IP utilization. Our subnet splitter is perfect for VLSM design—split a /24 into a /26 (62 hosts) for servers, /28 (14 hosts) for management, and /27 (30 hosts) for users.
Start Calculating Subnets Now
Calculate network ranges, host counts, and subnet masks in seconds. Enter any CIDR address above—free, instant results, no registration required.
Calculate