Skip to main content

Online Calculator Lab

IP Subnet Calculator

Enter any IPv4 address and CIDR prefix to get subnet mask, network address, broadcast, host range & usable hosts instantly. Free.

IP Address
/
⚠️ Please enter a valid IPv4 address (e.g. 192.168.1.0)
Network Address
Broadcast Address
Subnet Mask
Wildcard Mask
First Usable Host
Last Usable Host
Total Addresses
Usable Hosts
IP Class
IP Type
Binary Representation
IP Addr
Mask
Network

What Is IP Subnetting?

Subnetting is the practice of dividing a single IP address range into smaller logical networks called subnets. Rather than assigning every device in an organization to one flat network, subnetting creates boundaries — each subnet operates as its own network segment, with its own network address and broadcast address bookending the usable host range.

Two things drive subnetting in practice: efficiency and security. A /24 subnet (192.168.1.0 through 192.168.1.255) contains 254 usable host addresses. Splitting it into four /26 subnets gives you four groups of 62 usable hosts each — the same 254 addresses distributed across isolated segments where a broadcast storm or security breach in one subnet doesn't automatically affect the others. Reference: RFC 1918 — Address Allocation for Private Internets

How to Use This Calculator

  1. Enter an IPv4 address — either a network address (192.168.1.0) or a host address within a network (192.168.1.100). The calculator automatically finds the containing network.
  2. Select a CIDR prefix (/1 through /32) from the dropdown — or type it directly after a slash in the IP field (192.168.1.0/24)
  3. Click "Calculate Subnet" to see the network address, broadcast address, subnet mask, wildcard mask, first and last usable hosts, total addresses, and usable host count
  4. The binary representation panel shows the IP address in binary — blue bits are the network portion, orange bits are the host portion, making the mask's function visual
  5. For prefixes /24 and smaller (/25, /26, /27…), a subnet division table appears showing all subnets that fit within a /24 block
📌 Host address input: Enter 192.168.1.100/26 and the calculator returns the subnet that host belongs to — network 192.168.1.64, broadcast 192.168.1.127, usable range 192.168.1.65–192.168.1.126. You don't need to find the network address manually first.

How Subnetting Works — The Math

Every IPv4 address is 32 bits. The CIDR prefix tells you how many of those bits identify the network versus the host portion. A /24 means 24 bits are network, 8 bits are host — 2⁸ = 256 total addresses, minus network and broadcast = 254 usable hosts.

Network address = IP AND subnet mask (bitwise) Broadcast address = Network address OR wildcard mask (bitwise) First host = Network address + 1 Last host = Broadcast address − 1 Total addresses = 2^(32 − prefix) Usable hosts = 2^(32 − prefix) − 2 Subnet mask from CIDR: set the leftmost N bits to 1, remainder to 0 /24 → 11111111.11111111.11111111.00000000 → 255.255.255.0 /26 → 11111111.11111111.11111111.11000000 → 255.255.255.192 Worked example — 192.168.1.100/26: IP: 11000000.10101000.00000001.01100100 Mask: 11111111.11111111.11111111.11000000 Network: 11000000.10101000.00000001.01000000 → 192.168.1.64 Wildcard:00000000.00000000.00000000.00111111 → 0.0.0.63 Broadcast:192.168.1.127 (network | wildcard) First host: 192.168.1.65 Last host: 192.168.1.126 Usable: 62 hosts (2^6 − 2 = 62)

CIDR Reference Table — Common Prefixes

The most-used CIDR prefixes in real network deployments, with verified host counts. Every "Usable Hosts" figure = 2^(32−prefix) − 2:

CIDRSubnet MaskTotal AddressesUsable HostsTypical Use
/8255.0.0.016,777,21616,777,214Large ISP, Class A allocation
/16255.255.0.065,53665,534Large enterprise, Class B
/24255.255.255.0256254Standard LAN segment — most common
/25255.255.255.128128126Split /24 into two halves
/26255.255.255.1926462Split /24 into four subnets
/27255.255.255.2243230Small department, VLAN segment
/28255.255.255.2401614Small office, server cluster
/29255.255.255.24886Small device group
/30255.255.255.25242Point-to-point router links
/31255.255.255.25420P2P links (RFC 3021, no broadcast)
/32255.255.255.25510Single host route, loopback
📌 The /30 for point-to-point links: When connecting two routers, you only need 2 usable host addresses — one for each router interface. A /30 gives exactly 4 total addresses (network + 2 hosts + broadcast) with 0 wasted. Using a /24 for a P2P link wastes 252 addresses. Most enterprise networks use /30 or /31 for all inter-router connections.

Private IP Ranges (RFC 1918)

Three address ranges are reserved for private networks and are never routed on the public internet. Any device behind a router using NAT (Network Address Translation) almost certainly has one of these addresses. Knowing the ranges helps immediately identify whether an IP is internal or public:

RangeCIDRTotal AddressesCommon Use
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216Large corporate networks, data centers
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576Medium enterprises, cloud VPCs
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536Home routers, small offices
127.0.0.0 – 127.255.255.255127.0.0.0/816,777,216Loopback (127.0.0.1 = localhost)
169.254.0.0 – 169.254.255.255169.254.0.0/1665,536APIPA — auto-assigned when DHCP fails

If you see a 169.254.x.x address on a Windows or macOS machine, it means the device tried DHCP and got no response — it assigned itself an APIPA address and is unreachable from the rest of the network until DHCP is fixed. Source: IANA — IPv4 Special-Purpose Address Registry

IPv4 Address Classes

Before CIDR (Classless Inter-Domain Routing) became the standard in 1993, IPv4 addresses were divided into fixed classes. Class-based addressing is rarely used today, but the terminology still appears in legacy documentation and some router configurations:

ClassFirst Octet RangeDefault MaskNetworksHosts per Network
Class A1 – 126255.0.0.0 (/8)12616,777,214
Class B128 – 191255.255.0.0 (/16)16,38465,534
Class C192 – 223255.255.255.0 (/24)2,097,152254
Class D224 – 239N/AMulticastN/A
Class E240 – 255N/AReserved/ResearchN/A

Most home routers use 192.168.x.x (Class C range) because it fits comfortably within the private allocation and the /24 default gives 254 host addresses — enough for any home or small office. Large enterprises and cloud providers predominantly use the 10.x.x.x range (/8) for its 16+ million addresses.

Dividing 192.168.1.0/24 into /26 Subnets

A common real-world scenario: you have a /24 network and need to split it into four equal subnets. Adding 2 bits to the prefix (/24 → /26) creates 2² = 4 subnets, each with 2⁶ − 2 = 62 usable hosts. The calculator's subnet division panel shows this automatically for the input — here's the manual breakdown:

SubnetNetwork AddressBroadcastFirst HostLast HostUsable
192.168.1.0/26192.168.1.0192.168.1.63192.168.1.1192.168.1.6262
192.168.1.64/26192.168.1.64192.168.1.127192.168.1.65192.168.1.12662
192.168.1.128/26192.168.1.128192.168.1.191192.168.1.129192.168.1.19062
192.168.1.192/26192.168.1.192192.168.1.255192.168.1.193192.168.1.25462

Four subnets × 62 usable hosts = 248 usable addresses out of 254 available in the /24. The 6 addresses lost are the four network addresses and four broadcast addresses (one per subnet) minus the original /24's two (network and broadcast) that were already consumed. This tradeoff — slightly fewer usable addresses in exchange for network segmentation — is worth it for security and traffic management in most environments.

5 Practical Subnetting Tips

  • Count subnet bits, not host bits. To split a /24 into subnets of at least 30 hosts each, work backward: 2ⁿ − 2 ≥ 30 → n = 5 host bits → prefix = 32 − 5 = /27 (30 usable hosts). For 60 hosts: n = 6 → /26 (62 usable). For 120 hosts: n = 7 → /25 (126 usable). Always use the smallest prefix that fits your host count, leaving room for growth.
  • Use /30 for all point-to-point router links. A link between two router interfaces needs exactly 2 usable addresses. Using a /24 for this wastes 252 addresses and consumes a subnet unnecessarily. Every inter-router link in a properly designed network uses /30 (4 total, 2 usable) or /31 (RFC 3021, 2 total, no network/broadcast designation).
  • 192.168.1.x is the world's most-used private subnet — and that's a problem for VPNs. When a remote employee's home router assigns 192.168.1.0/24 and the office network also uses 192.168.1.0/24, the VPN can't route correctly because both ends look like the same network. Enterprise VPN designs use less common ranges (10.100.x.x, 172.16–31.x.x) to avoid this overlap.
  • The wildcard mask is the inverse of the subnet mask — useful for ACLs and routing protocols. If subnet mask = 255.255.255.192, wildcard = 0.0.0.63 (each octet: 255 minus the mask octet). Cisco ACLs use wildcard masks; most subnet calculators show both. The wildcard tells the router which bits to ignore when matching an address.
  • VLSM (Variable Length Subnet Masking) lets you right-size each subnet. Instead of giving every segment the same /26, assign /30 to P2P links (2 hosts), /27 to small departments (30 hosts), /25 to large floors (126 hosts), all carved from the same /24. This wastes far fewer addresses than fixed-length subnetting and is standard practice in modern network design.

Reference: RFC 4632 — Classless Inter-domain Routing (CIDR) | IANA IPv4 Special-Purpose Registry

Frequently Asked Questions — IP Subnet Calculator

They're bitwise inverses of each other. A subnet mask uses 1s to mark the network bits and 0s for host bits — 255.255.255.0 means 24 network bits. A wildcard mask flips that: 0s mark bits that must match, 1s mark bits that can be anything — 0.0.0.255 means "match the first three octets exactly, any value in the last." Subnet masks are used with IP addresses for interface configuration; wildcard masks appear in Cisco ACLs and OSPF configurations. To convert: subtract each subnet mask octet from 255 — 255 minus 255.255.255.192 = 0.0.0.63.
Two addresses in every subnet are reserved and cannot be assigned to devices: the network address (all host bits = 0, e.g., 192.168.1.0) identifies the subnet itself, and the broadcast address (all host bits = 1, e.g., 192.168.1.255) is used to send a packet to every device in the subnet simultaneously. Assigning either address to a device causes routing problems. So a /24 with 256 total addresses has 256 − 2 = 254 usable hosts. The exceptions are /31 (RFC 3021 allows both addresses for P2P links) and /32 (single host, no network/broadcast concept).
You're right — 192.168.1.100 is a host address within a /26 subnet, not the network address itself. When you enter a host address with a prefix, the calculator applies the subnet mask to find the containing network: 192.168.1.100 AND 255.255.255.192 = 192.168.1.64. So the host 192.168.1.100/26 belongs to the 192.168.1.64/26 subnet (broadcast 192.168.1.127, usable range .65–.126). This is useful when you know a device's IP and want to find which subnet it's on.
CIDR (Classless Inter-Domain Routing) was introduced in 1993 via RFC 1519 (updated as RFC 4632) to solve the exhaustion of the IPv4 address space under the old classful system. Under classes, organizations got a full /8 (16M addresses), /16 (65K), or /24 (254) — nothing in between. CIDR allows any prefix length from /0 to /32, so an ISP can assign a /22 (1,022 hosts) instead of wasting a full /16. CIDR also enables route aggregation (supernetting), where multiple contiguous networks are advertised as a single route, shrinking routing table sizes globally.
That's an APIPA (Automatic Private IP Addressing) address — Windows and macOS assign one from the 169.254.0.0/16 range when DHCP fails. It means your device couldn't reach a DHCP server to get a real IP address. Common causes: the DHCP server is down, the router is misconfigured, a bad cable, or the wrong VLAN. Devices with APIPA addresses can communicate with each other (if they're on the same link), but they can't reach the internet or any other subnet. Fix: check the physical connection, restart the router, or set a static IP temporarily.
The formula: subnets = 2^(new_prefix − original_prefix). To split a /24 into /26 subnets: 2^(26−24) = 2² = 4 subnets, each with 62 usable hosts. To split a /16 into /24 subnets: 2^(24−16) = 2⁸ = 256 subnets. Going the other way — if you need to fit 50 hosts per subnet in a /24 — calculate the prefix: need 2ⁿ − 2 ≥ 50, so n = 6 host bits, prefix = 32 − 6 = /26 (62 usable), giving 4 subnets. The subnet division table in this calculator shows the breakdown automatically when you enter a /24 or smaller prefix.