IP Subnet Calculator — Free CIDR & Subnet Mask Tool

An IP subnet calculator that finds the network address, broadcast address, usable host range, subnet mask and wildcard mask for any IPv4 address and CIDR. Type an IP — results update instantly. Free, no sign-up.



Network address —
Broadcast address —
Usable host range —
Total / usable hosts —
Subnet mask —
Wildcard mask —
IP class —
IP in binary —

CIDR /8–/30Usable host rangeWildcard maskNo sign-up

The 30-Second Answer

A subnet calculator takes an IP address and a subnet mask (or CIDR prefix like /24) and instantly returns the network address, broadcast address, usable host range, and host counts. Network engineers use it to carve up address space for VLANs, router links, and cloud VPCs; students use it to check CCNA subnetting practice.

What Is a Subnet Calculator?

A subnet calculator (also called a CIDR calculator or IP subnetting calculator) computes everything about an IPv4 subnet from just an address and a prefix length. Type 192.168.1.10 with /24 and it tells you the network is 192.168.1.0, the broadcast is 192.168.1.255, devices can use 192.168.1.1 through 192.168.1.254, and there are 254 usable hosts.

IT professionals reach for it when configuring routers, firewalls, DHCP scopes, and VPC subnets — anywhere a wrong mask means an outage. The calculator above does the binary math for you, but the sections below teach you how the math works, so you can subnet in your head too.

CIDR Cheat Sheet: Subnet Masks & Usable Hosts (/8–/30)

The single most useful subnetting reference: every common prefix with its mask, wildcard, and host counts. A /24 subnet has 256 total IP addresses and 254 usable hosts — the first (network) and last (broadcast) addresses can’t be assigned to devices.

CIDR Subnet mask Wildcard mask Total addresses Usable hosts Common use
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214 Large enterprise / ISP
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606 —
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302 —
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150 —
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574 —
/13 255.248.0.0 0.7.255.255 524,288 524,286 —
/14 255.252.0.0 0.3.255.255 262,144 262,142 —
/15 255.254.0.0 0.1.255.255 131,072 131,070 —
/16 255.255.0.0 0.0.255.255 65,536 65,534 Large organization
/17 255.255.128.0 0.0.127.255 32,768 32,766 —
/18 255.255.192.0 0.0.63.255 16,384 16,382 —
/19 255.255.224.0 0.0.31.255 8,192 8,190 —
/20 255.255.240.0 0.0.15.255 4,096 4,094 —
/21 255.255.248.0 0.0.7.255 2,048 2,046 —
/22 255.255.252.0 0.0.3.255 1,024 1,022 Campus / medium network
/23 255.255.254.0 0.0.1.255 512 510 Large LAN
/24 255.255.255.0 0.0.0.255 256 254 Standard LAN
/25 255.255.255.128 0.0.0.127 128 126 Branch office
/26 255.255.255.192 0.0.0.63 64 62 Department VLAN
/27 255.255.255.224 0.0.0.31 32 30 Small office
/28 255.255.255.240 0.0.0.15 16 14 Server VLAN
/29 255.255.255.248 0.0.0.7 8 6 Tiny segment
/30 255.255.255.252 0.0.0.3 4 2 Point-to-point WAN link
/31 255.255.255.254 0.0.0.1 2 2 (RFC 3021) Point-to-point, no reservation
/32 255.255.255.255 0.0.0.0 1 1 Single host / loopback

How to Use This Subnet Calculator

  1. Type any IPv4 address, e.g. 192.168.1.10. Invalid addresses show a clear error.
  2. Pick the CIDR prefix (/24 is the common home-network default).
  3. Network, broadcast, host range, masks and IP class appear instantly as you type.
  4. Change the prefix to compare subnet sizes — switch /24 to /25 and watch the network split into two 126-host halves.

Worked Example: 192.168.1.10/24

Here is exactly what the calculator returns for a typical home-network address:

IP: 192.168.1.10   CIDR: /24
Network: 192.168.1.0 — the AND of IP and mask
Broadcast: 192.168.1.255 — last address in the subnet
Usable range: 192.168.1.1 – 192.168.1.254
Subnet mask: 255.255.255.0   Wildcard: 0.0.0.255
Hosts: 2^8 − 2 = 254 usable addresses
Class: C — Private (RFC 1918)

Why 254 and not 256? The first address (.0) identifies the network itself and the last (.255) is the broadcast address that reaches every device on the subnet. Neither can be assigned to a device, so you always subtract 2.

How Subnet Math Works (Binary Walkthrough)

Every subnet calculation is a bitwise AND: line up the IP address and the subnet mask in binary, and AND each bit. Let’s find the network address of 192.168.1.50 with mask 255.255.255.240 (/28):

Decimal Binary
IP address 192.168.1.50 11000000.10101000.00000001.00110010
Subnet mask (/28) 255.255.255.240 11111111.11111111.11111111.11110000
Network (AND) 192.168.1.48 11000000.10101000.00000001.00110000

Look at the last octet: 50 = 00110010 AND 240 = 11110000 gives 00110000 = 48. The network is 192.168.1.48, the broadcast is 192.168.1.63, and devices can use .49 through .62 — 14 usable hosts, exactly what the cheat sheet says for /28.

The three formulas behind every result on this page:

Total addresses = 2^(32 − CIDR)
Usable hosts = 2^(32 − CIDR) − 2 (except /31 and /32 — see below)
Subnets from borrowing n bits = 2^n

The Magic-Number Shortcut (Mental Subnetting)

The fastest way to subnet without binary — a favorite on CCNA exams. The magic number is 256 minus the interesting octet of the mask (the octet that isn’t 0 or 255):

CIDR Mask (last octet) Magic number
/25 128 128
/26 192 64
/27 224 32
/28 240 16
/29 248 8
/30 252 4

How to use it: count by the magic number from 0 to find the subnet boundaries. Example — which subnet is 192.168.5.73/27 in? Magic number = 256 − 224 = 32. Boundaries: 0, 32, 64, 96, 128… — 73 falls in the 64 block, so the network is 192.168.5.64, broadcast 192.168.5.95, usable .65–.94. No binary needed.

VLSM: Splitting One Network Into Unequal Subnets

VLSM (Variable Length Subnet Masking) means using different prefix lengths inside one address block so each department gets only what it needs. To split 192.168.10.0/24 into 4 equal subnets, borrow 2 bits (→ /26, mask 255.255.255.192, 62 usable hosts each):

Subnet Network Usable range Broadcast
1 192.168.10.0/26 .1 – .62 192.168.10.63
2 192.168.10.64/26 .65 – .126 192.168.10.127
3 192.168.10.128/26 .129 – .190 192.168.10.191
4 192.168.10.192/26 .193 – .254 192.168.10.255

For unequal subnets, follow the golden rule: allocate the largest requirement first, then the next largest, and so on. Carving the big blocks first prevents a small subnet from landing in the middle of space a larger one needs.

Subnet Mask vs. Wildcard Mask

A wildcard mask is the bitwise inverse of the subnet mask — every 1 becomes 0 and every 0 becomes 1:

Decimal Binary (last octet)
Subnet mask 255.255.255.240 11110000
Wildcard mask 0.0.0.15 00001111

Wildcard masks are used in Cisco access-control lists (ACLs) and OSPF network statements, where the logic is flipped from subnet masks: a 0 bit means “must match” and a 1 bit means “ignore”. So access-list 10 permit 192.168.1.0 0.0.0.255 matches the entire 192.168.1.0/24 network. Mixing the two up is one of the most common Cisco config errors.

Special Cases: /31 and /32 (RFC 3021)

Two prefixes break the “minus 2” rule. RFC 3021 defines /31 for point-to-point links between two routers: with only 2 addresses in the subnet, both are usable — there is no network or broadcast reservation. A link numbered 192.168.1.0/31 gives usable addresses 192.168.1.0 and 192.168.1.1, saving address space compared to a /30.

A /32 is a single host — one address, mask 255.255.255.255. You’ll see it on loopback interfaces and in host routes. The calculator above covers /8–/30 (the range used for real subnets); the cheat sheet includes the /31 and /32 rows for reference.

Supernetting (Route Summarization) Explained

Supernetting is subnetting in reverse: combining several small networks into one larger advertisement. Four contiguous /24 networks can be summarized as a single /22:

192.168.0.0/24 + 192.168.1.0/24 + 192.168.2.0/24 + 192.168.3.0/24
→ 192.168.0.0/22 — one route covering 192.168.0.0 – 192.168.3.255 (1,024 addresses)

ISPs and backbone routers aggregate routes this way to keep global routing tables small — instead of four entries, one entry does the job. The requirement is that the networks be contiguous and align on the summary boundary.

Private IP Address Ranges (RFC 1918)

RFC 1918 reserves three blocks for internal networks. These addresses are never routed on the public internet — they’re reused inside homes, offices, and cloud VPCs behind NAT:

Range CIDR Addresses Typical use
10.0.0.0 – 10.255.255.255 10.0.0.0/8 16,777,216 Very large private networks, cloud VPCs
172.16.0.0 – 172.31.255.255 172.16.0.0/12 1,048,576 Medium organizations, container networks
192.168.0.0 – 192.168.255.255 192.168.0.0/16 65,536 Home and small-office routers

For reference, the classic IP classes are: Class A 1.0.0.0–126.255.255.255 (default /8), Class B 128.0.0.0–191.255.255.255 (default /16), Class C 192.0.0.0–223.255.255.255 (default /24), Class D 224.0.0.0–239.255.255.255 (multicast), and Class E 240.0.0.0–255.255.255.255 (experimental).

Common Subnetting Mistakes to Avoid

  1. Forgetting the “minus 2”. A /24 has 254 usable hosts, not 256. The network and broadcast addresses are reserved — always.
  2. Assigning the network or broadcast address to a device. Putting 192.168.1.0 or 192.168.1.255 on a host breaks connectivity for the whole subnet.
  3. Creating overlapping subnets. 192.168.1.0/25 (.0–.127) and 192.168.1.0/26 (.0–.63) overlap — the second must start at .64.
  4. Using a /30 where a /31 would do. On point-to-point router links, /31 (RFC 3021) wastes zero addresses; /30 wastes two.
  5. Mixing up subnet and wildcard masks in ACLs. In a wildcard mask, 0 means “must match” — the exact opposite of subnet-mask logic.

IP Subnet FAQs

How many hosts are in a /24 subnet?
A /24 subnet has 256 total IP addresses and 254 usable hosts. The first address is the network address and the last is the broadcast address — neither can be assigned to a device. The math: 2^(32−24) − 2 = 256 − 2 = 254.
How many usable hosts are in a /25 subnet?
A /25 subnet has 128 total addresses and 126 usable hosts (128 − 2, reserving the network and broadcast addresses). Its subnet mask is 255.255.255.128.
What is the subnet mask for a /26?
The subnet mask for a /26 is 255.255.255.192. It leaves 6 host bits, giving 64 total addresses and 62 usable hosts.
How many hosts can a /28 subnet hold?
A /28 subnet holds 16 total addresses and 14 usable hosts. Its subnet mask is 255.255.255.240 — handy for small VLANs or server segments.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation writes an IP address followed by a slash and the number of network bits — for example, 192.168.1.0/24. The /24 means the first 24 of the 32 bits identify the network, and the remaining 8 bits identify hosts on it.
What is the difference between a subnet mask and a wildcard mask?
A wildcard mask is the bitwise inverse of the subnet mask: every 1 becomes 0 and every 0 becomes 1. For example, subnet mask 255.255.255.0 pairs with wildcard 0.0.0.255. Wildcard masks are used in Cisco access-control lists (ACLs) and OSPF network statements, where a 0 bit means “must match” and a 1 bit means “ignore”.
How do I find the network address from an IP and subnet mask?
Perform a bitwise AND of the IP address and the subnet mask. For example, 192.168.1.50 AND 255.255.255.240: in the last octet, 50 (00110010) AND 240 (11110000) = 48 (00110000), giving network address 192.168.1.48. The calculator above does the AND operation for you instantly.
What is the broadcast address of 192.168.1.0/24?
192.168.1.255. It is the last address in the subnet — all 8 host bits set to 1. Traffic sent to the broadcast address reaches every device on that subnet.
What is a /31 subnet used for?
A /31 subnet is used for point-to-point links between two routers, as defined in RFC 3021. With only 2 addresses and no network/broadcast reservation, both addresses are usable — for example, 192.168.1.0/31 gives usable addresses 192.168.1.0 and 192.168.1.1.
How do I split 192.168.1.0/24 into 4 equal subnets?
Borrow 2 bits from the host portion to get 4 subnets of /26 each (subnet mask 255.255.255.192), with 62 usable hosts per subnet: 192.168.1.0/26 (usable .1–.62, broadcast .63), 192.168.1.64/26 (usable .65–.126, broadcast .127), 192.168.1.128/26 (usable .129–.190, broadcast .191), and 192.168.1.192/26 (usable .193–.254, broadcast .255).
What does 255.255.255.0 mean in CIDR?
255.255.255.0 is a /24 in CIDR notation — the first 24 bits are network bits and the last 8 bits are host bits, giving 256 total addresses and 254 usable hosts.
What are the private IP address ranges?
The private IPv4 ranges defined in RFC 1918 are 10.0.0.0/8 (16.7 million addresses), 172.16.0.0/12 (about 1 million), and 192.168.0.0/16 (65,536). These addresses are never routed on the public internet — they are reused inside homes, offices, and cloud VPCs.