Skip to main content

CIDR/Subnet Calculator

Enter an IPv4 address and CIDR prefix length to calculate network details including subnet mask, host range, broadcast address, and more.

Ad (leaderboard)
Rate this tool
0.0 / 5 · 0 ratings

Embed This Calculator

Add this calculator to your website for free. Copy the single line of code below and paste it into your HTML. The calculator auto-resizes to fit your page.

<script src="https://calchammer.com/embed.js" data-calculator="cidr-subnet-calculator" data-category="everyday"></script>
data-theme "light", "dark", or "auto"
data-values Pre-fill inputs, e.g. "amount=1000"
data-max-width Max width, e.g. "600px"
data-border "true" or "false"
Or use an iframe instead
<iframe src="https://calchammer.com/embed/everyday/cidr-subnet-calculator" width="100%" height="500" style="border:none;border-radius:12px;" title="Subnet Calculator Calculator"></iframe>

Preview

yoursite.com/blog
Subnet Calculator Calculator auto-resizes here
Ad (in_results)

Understanding IP Addressing and Subnetting

Every device on an IP network needs a unique address to communicate. An IPv4 address is a 32-bit number written as four octets separated by dots, such as 192.168.1.100. Each octet ranges from 0 to 255. To organize networks efficiently, IP addresses are divided into a network portion and a host portion using a subnet mask. The subnet mask determines which bits identify the network and which bits identify individual hosts on that network. Subnetting is the process of creating these divisions, and it is a fundamental skill in network engineering.

Without subnetting, every organization would need a single, flat network for all its devices. This creates excessive broadcast traffic, security risks from lack of segmentation, and wasted IP addresses. Subnetting solves these problems by dividing one large network into multiple smaller networks, each with its own broadcast domain and address space.

Ad (in_content)

CIDR Notation vs Classful Addressing

The original IP addressing system used fixed classes. Class A networks used an 8-bit prefix (/8), Class B used 16 bits (/16), and Class C used 24 bits (/24). This created enormous waste: an organization needing 300 addresses had to use a Class B network with 65,534 addresses. CIDR (Classless Inter-Domain Routing) replaced this system in 1993, allowing prefix lengths from /0 to /32. CIDR enables precise allocation: a /23 provides 510 usable hosts, and a /25 provides 126. This flexibility dramatically reduced IP address waste and slowed the exhaustion of the IPv4 address space.

How Subnet Masks Work

A subnet mask is a 32-bit value where contiguous 1-bits mark the network portion and contiguous 0-bits mark the host portion. When a device performs a bitwise AND operation between an IP address and its subnet mask, the result is the network address. For example, the IP 192.168.1.100 with mask 255.255.255.0 (/24) yields network 192.168.1.0. The wildcard mask is the inverse of the subnet mask, with 0-bits for the network and 1-bits for the host portion. Wildcard masks are commonly used in access control lists on Cisco routers and firewalls.

Private IP Ranges and NAT

RFC 1918 reserves three address ranges for private networks: 10.0.0.0/8 (over 16 million addresses), 172.16.0.0/12 (about 1 million addresses), and 192.168.0.0/16 (about 65,000 addresses). These addresses cannot be routed on the public internet. Organizations use them internally and connect to the internet through NAT (Network Address Translation), which maps private addresses to one or more public addresses. The 192.168.x.x range is the most common for home and small office networks, while 10.x.x.x is preferred for larger enterprise networks due to its larger address space.

Choosing the Right Subnet Size

Variable Length Subnet Masking (VLSM) allows different subnets within the same network to use different prefix lengths. This is essential for efficient IP allocation. A server VLAN with 20 servers might use a /27 (30 usable hosts), while a user VLAN with 200 workstations needs a /24 (254 usable hosts), and a point-to-point link between routers needs only a /30 (2 usable hosts) or /31 (2 addresses with no broadcast). Planning subnet sizes carefully minimizes wasted addresses and leaves room for future growth. IPv4 address exhaustion has been a reality since 2011, making efficient subnetting more important than ever.

Frequently Asked Questions

What is subnetting?

Dividing a large IP network into smaller sub-networks for better management, security, and address efficiency. Each subnet has its own address range and broadcast domain.

What is CIDR notation?

An IP address followed by a slash and prefix length, like 192.168.1.0/24. The prefix length indicates how many bits identify the network (24 bits = 255.255.255.0 mask).

What is the difference between network and broadcast addresses?

The network address (all host bits 0) identifies the subnet. The broadcast address (all host bits 1) reaches all hosts. Neither can be assigned to devices.

What are private IP ranges?

10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are reserved for private networks. They require NAT to communicate with the public internet.

How do I choose the right subnet size?

Count the hosts you need, add room for growth, then pick the smallest subnet that fits. For 50 hosts, use /26 (62 usable). For 10 hosts, use /28 (14 usable).

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and should not be considered professional expert advice. Consult a qualified professional before making decisions based on these calculations. See our full Disclaimer.