IP Subnet Calculator

Enter any IPv4 address with a CIDR prefix or subnet mask to get the network address, broadcast, host range, wildcard mask, and usable host count instantly.

🌐 IP Subnet Calculator
/ bits
Network Address
Subnet Mask
Wildcard Mask
Broadcast Address
First Usable Host
Last Usable Host
Usable Hosts
IP Class

Binary representation

🌐 What is IP Subnetting?

IP subnetting is the fundamental networking technique of dividing a single IP address block into smaller sub-networks (subnets). Every device on a network needs a unique IP address, but IP addresses are not unlimited — the entire IPv4 address space contains only about 4.3 billion addresses (2³²). Subnetting allows network engineers to allocate IP space efficiently, segment networks for security and performance, and control broadcast traffic by confining it to smaller domains.

An IPv4 address like 192.168.1.100 is a 32-bit number divided into a network portion and a host portion. The subnet mask (or CIDR prefix length) determines where that boundary falls. A /24 mask (255.255.255.0) means the first 24 bits identify the network (192.168.1.0) and the remaining 8 bits identify hosts — allowing up to 254 devices (256 minus the network address and broadcast address). A /16 (255.255.0.0) gives the same first 16 bits for the network and 16 bits for hosts — 65,534 possible host addresses.

Real-world subnetting applications are everywhere. Enterprise networks use subnets to separate departments (Finance on 10.1.1.0/24, HR on 10.1.2.0/24) so that a compromise in one segment does not spread laterally. Data centres use Variable Length Subnet Masking (VLSM) to allocate exactly the right-sized subnet to each server cluster. Internet service providers (ISPs) allocate customer blocks like 203.0.113.0/28 (14 usable IPs) or /26 (62 IPs) based on stated needs. Router ACLs use wildcard masks to specify which subnets rules apply to.

This calculator handles both CIDR prefix notation (e.g., /24) and traditional dotted decimal subnet masks (e.g., 255.255.255.0). It computes the network address, broadcast address, usable host range, wildcard mask, and displays full binary representations — the same information a network engineer reads when configuring a router or firewall. The binary view makes the bitwise AND operation behind subnetting immediately visible.

📐 Formula

Network = IP AND Mask    Broadcast = Network OR NOT(Mask)
Prefix /n = n leading 1-bits in the mask, then 32−n zero bits
Subnet mask from prefix /24: 11111111.11111111.11111111.00000000 = 255.255.255.0
Network address = IP AND mask (bitwise)
Broadcast = network OR wildcard (all host bits = 1)
Usable hosts = 2^(32−prefix) − 2
Wildcard mask = NOT(subnet mask) = 0.0.0.255 for a /24
Example: 192.168.1.100/24 → Network 192.168.1.0, Broadcast 192.168.1.255, Hosts: 192.168.1.1–192.168.1.254 (254 usable)

📖 How to Use This Calculator

Steps

1
Enter the IP address — Type any valid IPv4 address in dotted decimal form (e.g., 192.168.1.100). This can be a host address or a network address — the calculator derives the correct network address by applying the mask.
2
Choose CIDR or subnet mask — By default, enter the CIDR prefix length (0–32). Uncheck “Use CIDR prefix” to switch to dotted decimal subnet mask mode (e.g., 255.255.255.0).
3
Read the subnet details — The results show network address, broadcast, first and last usable host, wildcard mask, usable host count, and IP class. The binary panel shows the bitwise operations used.

💡 Example Calculations

Example 1 — Class C Subnet (the Most Common)

192.168.10.50 / 24

1
Mask = 255.255.255.0. Network = 192.168.10.50 AND 255.255.255.0 = 192.168.10.0
2
Broadcast = 192.168.10.0 OR 0.0.0.255 = 192.168.10.255
3
Usable hosts = 2^(32−24) − 2 = 256 − 2 = 254. Range: 192.168.10.1 to 192.168.10.254
Network: 192.168.10.0/24  |  254 usable hosts  |  Private Class C
Try this example →

Example 2 — Smaller Subnet for a VLAN

10.10.5.1 / 28 (14 hosts — typical for a small VLAN)

1
Mask = 255.255.255.240. Network = 10.10.5.1 AND 255.255.255.240 = 10.10.5.0
2
Broadcast = 10.10.5.0 OR 0.0.0.15 = 10.10.5.15
3
Hosts = 2^4 − 2 = 14. Range: 10.10.5.1 to 10.10.5.14. Wildcard: 0.0.0.15
Network: 10.10.5.0/28  |  14 usable hosts  |  Private Class A  |  Wildcard: 0.0.0.15
Try this example →

Example 3 — Large Enterprise Block

172.16.0.0 / 16

1
Mask = 255.255.0.0. Network = 172.16.0.0, Broadcast = 172.16.255.255
2
Hosts = 2^16 − 2 = 65,534. Range: 172.16.0.1 to 172.16.255.254
3
Class B private address. Can be subdivided into 256 × /24 subnets of 254 hosts each for department segmentation.
Network: 172.16.0.0/16  |  65,534 usable hosts  |  Private Class B
Try this example →

❓ Frequently Asked Questions

What is IP subnetting?+
IP subnetting is the practice of dividing a single IP network block into smaller sub-networks. It allows more efficient use of IP address space, better network segmentation for security and performance, and reduced broadcast domains. Each subnet has its own network address, broadcast address, and range of assignable host addresses, defined by the subnet mask or CIDR prefix length.
What is CIDR and how is it different from classful IP addressing?+
CIDR (Classless Inter-Domain Routing, RFC 1519, 1993) replaced the rigid classful system. In classful addressing, an IP’s first bits determined its class (A=/8, B=/16, C=/24) and default mask. CIDR allows any prefix length from /0 to /32, enabling Variable Length Subnet Masking (VLSM). This eliminated wasted space: a company needing 300 hosts formerly got an entire /16 (65,534 hosts); with CIDR they get a /23 (510 hosts).
How many hosts does each CIDR prefix support?+
Usable hosts = 2^(32−prefix) − 2. Key values: /30 = 2, /29 = 6, /28 = 14, /27 = 30, /26 = 62, /25 = 126, /24 = 254, /23 = 510, /22 = 1022, /21 = 2046, /20 = 4094, /16 = 65534, /8 = 16,777,214. Exception: /31 supports 2 hosts (no subtraction per RFC 3021) for point-to-point links. /32 is a single-host route.
What are the three private IP address ranges?+
RFC 1918 defines three private (non-routable on public internet) ranges: 10.0.0.0/8 (Class A: 16.7M addresses), 172.16.0.0/12 (Class B range: 1.05M addresses, 172.16.x.x to 172.31.x.x), and 192.168.0.0/16 (Class C range: 65,536 addresses). Home routers assign 192.168.x.x addresses. Enterprise networks typically use 10.x.x.x. NAT translates these to public IPs at the network boundary.
What is a subnet mask and how does it work?+
A subnet mask is a 32-bit number with consecutive 1s (network bits) followed by 0s (host bits). Applied via bitwise AND to an IP address, it extracts the network address. Example: 192.168.1.100 AND 255.255.255.0 = 192.168.1.0 (network). The 1s mark which bits of the IP address identify the network; the 0s mark which bits can vary to address individual hosts within that network.
What is a wildcard mask and where is it used?+
A wildcard mask is the bitwise inverse of a subnet mask: 0.0.0.255 is the wildcard for 255.255.255.0. In wildcard notation, 0 = must match, 1 = don’t care. Wildcard masks are used in Cisco IOS ACLs (access-list 1 permit 10.1.0.0 0.0.255.255 = match any IP in 10.1.x.x) and in OSPF area configurations. They give more flexibility than subnet masks for specifying arbitrary bit patterns.
What is the network address and why can't I assign it to a host?+
The network address is the first address in a subnet, with all host bits set to 0 (e.g., 192.168.1.0 in a /24). It identifies the subnet itself in routing tables: a router’s routing table says “send packets for 192.168.1.0/24 out interface X.” Assigning it to a host would confuse routers, as the host’s address would be indistinguishable from the network identifier. Similarly, the broadcast address (all host bits = 1) is reserved for subnet-wide broadcasts.
How do I split a network into equal subnets?+
To divide a network into N equal subnets, borrow ⌈log&sub2;(N)⌉ bits from the host portion (increase the prefix by that many bits). Example: split 10.0.0.0/24 into 4 subnets → borrow 2 bits → /26. The 4 subnets: 10.0.0.0/26 (hosts .1–.62), 10.0.0.64/26 (hosts .65–.126), 10.0.0.128/26 (hosts .129–.190), 10.0.0.192/26 (hosts .193–.254). Each has 62 usable hosts.
What is Variable Length Subnet Masking (VLSM)?+
VLSM allows different subnets within the same network to use different prefix lengths, allocating IP space efficiently. Example: a company has 10.1.0.0/16. Department A needs 200 hosts → assign 10.1.1.0/24. Department B needs 30 hosts → assign 10.1.2.0/27. A point-to-point WAN link needs 2 hosts → assign 10.1.3.0/30. Without VLSM (classful), all subnets would have the same size, wasting most addresses.
How does NAT relate to subnetting?+
NAT (Network Address Translation) allows multiple devices using private IP addresses (RFC 1918) to share a single public IP. A home router assigns private 192.168.1.x addresses to devices, then translates them to its single public IP when forwarding traffic to the internet. NAT extended the life of IPv4 by allowing millions of private subnets to operate behind small public IP allocations. IPv6 eliminates the need for NAT by providing ~3.4 × 10^38 addresses.