Subnet Calculator

Calculate subnet details for any IPv4 or IPv6 address. Enter an IP and CIDR prefix to instantly get network address, broadcast address, usable host range, wildcard mask, and total hosts. Includes full CIDR reference table and binary breakdown.

.
.
.

Tip: Press "." to advance to next octet. Paste a full IP or CIDR (e.g. 10.0.0.0/8).

Network Address
192.168.1.0/24
Usable Hosts
254
Total
256
Class
C
Type
Private

Address Details

Network boundaries and host range

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Usable Hosts254
Total Addresses256

Subnet Masks

Mask representations for this subnet

Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
CIDR Notation/24
Network TypePrivate (RFC 1918)

Binary & Hex

Machine-level representations

Binary Subnet Mask
11111111.11111111.11111111.00000000
Binary IP Address
11000000.10101000.00000001.00000000
Hex IP0xC0A80100

CIDR Reference Table

Common IPv4 CIDR prefixes

CIDRSubnet MaskTotalUsable
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

How Subnet Calculation Works

Understanding the math behind IP subnetting

Subnetting divides a network into smaller segments by borrowing bits from the host portion of an IP address. The subnet mask tells routers which bits are the network portion and which are the host portion.

Network = IP AND Mask
Bitwise AND operation
Broadcast = Network OR ~Mask
OR with inverted mask

For example, 192.168.1.130/24: the mask is 255.255.255.0 (24 bits of 1s). Performing 192.168.1.130 AND 255.255.255.0 gives the network address 192.168.1.0. The broadcast address is 192.168.1.255, and usable hosts range from .1 to .254 (254 hosts).

Usable Hosts Formula
Usable Hosts = 2(32 – prefix) – 2
Subtract 2 for the network address and broadcast address. Exception: /31 has 2 usable (RFC 3021), /32 has 1 (single host).

Understanding CIDR Notation

Classless Inter-Domain Routing explained

CIDR notation (e.g., 192.168.1.0/24) combines an IP address with its prefix length. The prefix number indicates how many leading bits form the network portion.

CIDRMaskHostsUse Case
/8255.0.0.016,777,214Large ISP / Class A
/16255.255.0.065,534Enterprise / Class B
/24255.255.255.0254Standard LAN
/27255.255.255.22430Small office
/30255.255.255.2522Point-to-point link
/32255.255.255.2551Single host route

CIDR replaced the older classful addressing system (Class A/B/C), enabling more efficient IP allocation. Instead of fixed /8, /16, or /24 boundaries, networks can be any prefix length from /0 to /32.

Common Subnet Sizes and Use Cases

Choosing the right subnet for your network

/24 — Standard Network

254 usable hosts. The most common subnet for home networks, small offices, and VLANs. Provides enough addresses for a typical department.

/16 — Enterprise Network

65,534 usable hosts. Used in large enterprise networks or campus environments. Provides a wide address range for segmentation with further subnetting.

/30 and /31 — Point-to-Point

/30 provides 2 usable hosts (traditional router-to-router). /31 (RFC 3021) uses both addresses without a broadcast — ideal for modern point-to-point links.

/28 — Small Server VLAN

14 usable hosts. Perfect for a DMZ, management VLAN, or a small group of servers where you want tight address control and minimal broadcast domain.

Common Subnetting Mistakes

Avoid these frequent errors in subnet planning

Forgetting to subtract network & broadcast

A /24 has 256 total addresses but only 254 usable hosts. The first address is the network address and the last is the broadcast address — neither can be assigned to a device.

Confusing subnet mask with wildcard mask

A subnet mask (255.255.255.0) and wildcard mask (0.0.0.255) are bitwise inverses. Subnet masks are used in IP configuration, while wildcards are used in Cisco ACLs and OSPF.

Oversizing the subnet

Using a /16 (65,534 hosts) when you need 50 hosts wastes address space. A /26 (62 hosts) is far more appropriate. Right-sizing subnets improves security and reduces broadcast traffic.

Ignoring reserved ranges

10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are private (RFC 1918) — not routable on the public internet. 127.0.0.0/8 is loopback and 169.254.0.0/16 is link-local (APIPA).

Frequently Asked Questions

Common questions about IP subnetting and subnet masks