PureDevTools

IP Subnet Calculator

Calculate IP subnets, CIDR ranges, network addresses, broadcast addresses, and available hosts — nothing leaves your browser.

All processing happens in your browser. No data is sent to any server.

IP Address & Subnet Mask

Accepts CIDR (/24) or dotted decimal (255.255.255.0)

Network Details

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Total Hosts256
Usable Hosts254
CIDR Notation192.168.1.0/24
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
IP ClassC
IP TypePrivate (RFC 1918)
IP Address192.168.1.0

Binary Representation

Network bits · Host bits

FieldBinary (dotted-octet)
IP Address11000000.10101000.00000001.00000000
Subnet Mask11111111.11111111.11111111.00000000
Network Address11000000.10101000.00000001.00000000
Broadcast11000000.10101000.00000001.11111111

Subnet Breakdown

Divide into:
#NetworkFirst HostLast HostBroadcastUsable
1192.168.1.0/25192.168.1.1192.168.1.126192.168.1.127126
2192.168.1.128/25192.168.1.129192.168.1.254192.168.1.255126

CIDR Quick Reference

PrefixSubnet MaskTotal HostsUsableNotes
/00.0.0.04295.0M4295.0MAll addresses (default route)
/8255.0.0.016.8M16.8MClass A block (16M+ hosts)
/12255.240.0.01.0M1.0MPrivate range 172.16.0.0/12
/16255.255.0.065.5K65.5KClass B block (65K+ hosts)
/20255.255.240.04.1K4.1KLarge subnet (4K+ hosts)
/21255.255.248.02.0K2.0KMedium-large subnet (2K+ hosts)
/22255.255.252.01.0K1.0KMedium subnet (1K+ hosts)
/23255.255.254.0512510Medium subnet (512 hosts)

What Is IP Subnetting?

Subnetting is the practice of dividing a large IP network into smaller, more manageable sub-networks (subnets). Each subnet has its own:

Subnetting is fundamental to network design, firewall rules, cloud VPC configuration, and OSPF/BGP routing.

Understanding CIDR Notation

CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length:

192.168.1.0/24
│           └─ 24 network bits → 8 host bits → 256 addresses
└─ Network IP address

The prefix length (0–32) specifies how many of the 32 IP bits represent the network. The remaining bits identify individual hosts.

CIDRSubnet MaskTotal AddressesUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/30255.255.255.25242
/32255.255.255.25511 (host route)

How to Calculate Subnet Information

Step 1: Apply the subnet mask

Perform a bitwise AND between the IP address and the subnet mask to find the network address:

IP:   192.168.1.100  →  11000000.10101000.00000001.01100100
Mask: 255.255.255.0  →  11111111.11111111.11111111.00000000
AND:  192.168.1.0    →  11000000.10101000.00000001.00000000

Step 2: Find the broadcast address

Flip all the host bits to 1 (OR with the wildcard mask):

Network: 192.168.1.0   →  11000000.10101000.00000001.00000000
Wildcard:  0.0.0.255   →  00000000.00000000.00000000.11111111
Broadcast: 192.168.1.255 → 11000000.10101000.00000001.11111111

Step 3: Count usable hosts

Total addresses = 2^(32 - prefix)
Usable hosts    = Total - 2  (subtract network and broadcast addresses)

For a /24: 2⁸ = 256 total, 254 usable.

What Is a Wildcard Mask?

The wildcard mask is the bitwise complement of the subnet mask — every 0 in the mask becomes 1, and every 1 becomes 0. It marks the “don’t care” bits.

Subnet mask:   255.255.255.0   = 11111111.11111111.11111111.00000000
Wildcard mask:   0.0.0.255   = 00000000.00000000.00000000.11111111

Wildcard masks are used extensively in:

IPv4 Address Classes

Before CIDR, IPv4 used a classful addressing scheme:

ClassRangeDefault MaskTypical Use
A1.0.0.0 – 126.255.255.255/8Large enterprises, ISPs
B128.0.0.0 – 191.255.255.255/16Medium organizations
C192.0.0.0 – 223.255.255.255/24Small networks
D224.0.0.0 – 239.255.255.255N/AMulticast groups
E240.0.0.0 – 255.255.255.255N/AReserved/experimental

CIDR superseded classful routing in 1993, allowing any prefix length — but the class system still appears in configuration tools and documentation.

Private IP Address Ranges (RFC 1918)

These ranges are reserved for private use and are not routable on the public internet:

RangeCIDRNotes
10.0.0.0 – 10.255.255.25510.0.0.0/8Large private networks
172.16.0.0 – 172.31.255.255172.16.0.0/12Medium private networks
192.168.0.0 – 192.168.255.255192.168.0.0/16Home and office networks

Additional reserved ranges:

Subnetting a Network

Subnetting divides a larger network into smaller ones by extending the prefix length. Each additional bit doubles the number of subnets and halves the host count:

Starting with 192.168.0.0/24 (254 hosts):

SubdivisionSubnetsHosts EachExample
/24 (unchanged)1254192.168.0.0/24
/252126192.168.0.0/25, 192.168.0.128/25
/26462192.168.0.0/26, …192.168.0.192/26
/27830192.168.0.0/27, …192.168.0.224/27
/281614192.168.0.0/28, …192.168.0.240/28
/30642Ideal for point-to-point links

Special Cases: /31 and /32

/31 — Point-to-point links (RFC 3021): Normally a subnet with 2 addresses would have 0 usable hosts (both consumed by network and broadcast). RFC 3021 defines /31 for point-to-point links where both addresses are usable, eliminating wasted IPs.

/32 — Host route: A /32 identifies a single IP address. Used for loopback interfaces, null routes (ip route 0.0.0.0/0 null0), and advertising specific host IPs in BGP.

Frequently Asked Questions

How many hosts can a /24 subnet hold? A /24 has 2⁸ = 256 addresses. Subtracting the network address (.0) and broadcast address (.255) leaves 254 usable host addresses.

What is the difference between /24 and 255.255.255.0? They are equivalent representations. /24 is CIDR notation indicating 24 network bits. 255.255.255.0 is the dotted-decimal form of the same mask — 24 consecutive 1s followed by 8 zeros.

How do I subnet a /22 into /24 networks? A /22 contains 4 times as many addresses as a /24 (because 24 - 22 = 2, and 2² = 4). Enter your /22 network address in the calculator, then use the Subnet Breakdown section to select /24, which will list all four /24 subnets within it.

What does the binary view tell me? The binary representation shows each octet as 8 bits. The colored network bits (left, determined by the prefix length) must match between a device’s IP and the network address for the device to be in that subnet. The host bits (right) can be anything within the valid host range.

Is my data private? Yes. All subnet calculations happen entirely in your browser using JavaScript. No IP addresses or network configurations are ever sent to any server, stored, or logged.

Related Tools