Free Tool

Subnet Calculator

Enter an IPv4 address and a CIDR prefix or subnet mask to get the network, broadcast, usable host range, wildcard mask and binary form. Then split the network into subnets or plan a VLSM layout. Everything runs in your browser.

Jump to the subnetting cheat sheet · Practice subnetting problems

IPv4 subnet calculator

Type the address and either a prefix (/24 or 24) or a dotted mask (255.255.255.0). You can also paste CIDR notation such as 10.1.1.77/26 into the address box.

192.168.1.0/24: 254 usable hosts from 256 total addresses.
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Total addresses
256
Usable hosts
254
Subnet mask
255.255.255.0 (/24)
Wildcard mask
0.0.0.255
IP class
Class C (by first octet; classful addressing is legacy)
Address type
Private (RFC 1918)

Binary representation

Binary form of the address, mask, wildcard, network and broadcast
IP address11000000.10101000.00000001.00001010
Subnet mask11111111.11111111.11111111.00000000
Wildcard00000000.00000000.00000000.11111111
Network11000000.10101000.00000001.00000000
Broadcast11000000.10101000.00000001.11111111

The first 24 bits are the network portion; the remaining 8 bits identify hosts.

Split into subnets

Divide the network above into equal-size smaller subnets. Enter a longer prefix than the original.

4 subnets of /26.

Subnets created by splitting the network
#NetworkHost rangeBroadcastUsable
1192.168.1.0/26192.168.1.1 - 192.168.1.62192.168.1.6362
2192.168.1.64/26192.168.1.65 - 192.168.1.126192.168.1.12762
3192.168.1.128/26192.168.1.129 - 192.168.1.190192.168.1.19162
4192.168.1.192/26192.168.1.193 - 192.168.1.254192.168.1.25562

VLSM helper

Enter the parent network and how many hosts each subnet needs. Requirements are sorted largest first and packed with no overlaps.

Subnet requirements

Uses 228 of 256 addresses (89%).

VLSM allocations sorted largest first
NameNeededNetworkMaskUsable rangeUsable
Sales100192.168.10.0/25255.255.255.128192.168.10.1 - 192.168.10.126126
Engineering50192.168.10.128/26255.255.255.192192.168.10.129 - 192.168.10.19062
Guest Wi-Fi20192.168.10.192/27255.255.255.224192.168.10.193 - 192.168.10.22230
WAN link2192.168.10.224/30255.255.255.252192.168.10.225 - 192.168.10.2262

Each subnet reserves a network and a broadcast address, so the smallest block offered is a /30 (2 usable hosts).

What is a subnet mask and CIDR prefix?

A subnet mask is a 32-bit value that splits an IPv4 address into a network part and a host part. The CIDR prefix is the same information written as a count of leading 1 bits: /24 means 255.255.255.0, /26 means 255.255.255.192 and /30 means 255.255.255.252. The longer the prefix, the smaller the subnet: each extra bit halves the number of addresses. Every result the calculator shows, from the network address to the usable host range, is derived from this split.

How does subnetting work?

An IPv4 address is 32 bits. A subnet mask (or its shorter CIDR form, the prefix length) marks which leading bits identify the network and which trailing bits identify hosts on it. Everything the calculator shows follows from that one split.

ValueFormulaExample: 10.1.1.77/26
Subnet maskFirst n bits set to 1255.255.255.192
Network addressIP AND mask10.1.1.64
Wildcard maskNOT mask0.0.0.63
Broadcast addressNetwork OR wildcard10.1.1.127
Total addresses2^(32 - n)64
Usable hosts2^(32 - n) - 262 (10.1.1.65 to 10.1.1.126)

Block-size shortcut. Find the interesting octet (the one where the mask is neither 255 nor 0). The block size is 256 minus the mask value in that octet. For /26 the mask octet is 192, so blocks are 64 apart: 0, 64, 128, 192. The address 77 lands in the block starting at 64.

Special cases. A /31 has no network or broadcast address and both addresses are usable on point-to-point links (RFC 3021). A /32 is one host. Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, RFC 1918) are not routed on the public internet, and the calculator flags these along with loopback, link-local, multicast and documentation ranges. The IP class shown is the legacy classful label based on the first octet; modern networks use CIDR instead.

How do I plan VLSM?

List every subnet and its host count, sort from largest to smallest, give each the smallest block with enough usable addresses, and place them one after another from the start of the parent network. Placing the biggest first keeps every block on a boundary that matches its size, so nothing overlaps. The VLSM helper above does exactly this. For a worked walkthrough, read VLSM explained.

Subnetting cheat sheet

Everything you need to subnet by hand, in one place. Learn the three-step method first, then use the table to check masks, block sizes and host counts. If you want a longer walkthrough, read Subnetting explained, and drill the method with the free subnetting practice trainer.

The three-step method

  1. Find the interesting octet and block size. It is the octet where the mask is neither 255 nor 0. Block size = 256 minus the mask value in that octet (a /26 mask octet is 192, so the block size is 64).
  2. Find the network address. In the interesting octet, take the largest multiple of the block size that is not above the address's own value. Copy earlier octets, set later octets to 0.
  3. Find the broadcast and host range. Broadcast = network + block size - 1 in the interesting octet, with later octets set to 255. First host is network + 1 and last host is broadcast - 1.

Mask octet values

Only nine values can appear in a mask octet. Memorise them: each extra network bit adds half of the previous step.

Network bits in octet012345678
Octet value0128192224240248252254255

CIDR prefix table (/8 to /32)

PrefixSubnet maskWildcardInteresting octetBlock sizeTotal addressesUsable hosts
/8255.0.0.00.255.255.2552nd25616,777,21616,777,214
/9255.128.0.00.127.255.2552nd1288,388,6088,388,606
/10255.192.0.00.63.255.2552nd644,194,3044,194,302
/11255.224.0.00.31.255.2552nd322,097,1522,097,150
/12255.240.0.00.15.255.2552nd161,048,5761,048,574
/13255.248.0.00.7.255.2552nd8524,288524,286
/14255.252.0.00.3.255.2552nd4262,144262,142
/15255.254.0.00.1.255.2552nd2131,072131,070
/16255.255.0.00.0.255.2553rd25665,53665,534
/17255.255.128.00.0.127.2553rd12832,76832,766
/18255.255.192.00.0.63.2553rd6416,38416,382
/19255.255.224.00.0.31.2553rd328,1928,190
/20255.255.240.00.0.15.2553rd164,0964,094
/21255.255.248.00.0.7.2553rd82,0482,046
/22255.255.252.00.0.3.2553rd41,0241,022
/23255.255.254.00.0.1.2553rd2512510
/24255.255.255.00.0.0.2554th256256254
/25255.255.255.1280.0.0.1274th128128126
/26255.255.255.1920.0.0.634th646462
/27255.255.255.2240.0.0.314th323230
/28255.255.255.2400.0.0.154th161614
/29255.255.255.2480.0.0.74th886
/30255.255.255.2520.0.0.34th442
/31255.255.255.2540.0.0.14th222
/32255.255.255.2550.0.0.04th111

Usable hosts = total - 2, except /31 (2 usable, point-to-point links, RFC 3021) and /32 (one host route). Block size is the step between subnet boundaries in the interesting octet; at /32 it is 1 and every address is its own subnet.

Private and special ranges to remember

RangeMeaning
10.0.0.0/8Private (RFC 1918)
172.16.0.0/12Private (RFC 1918), 172.16.0.0 to 172.31.255.255
192.168.0.0/16Private (RFC 1918)
127.0.0.0/8Loopback
169.254.0.0/16Link-local / APIPA (no DHCP answer)
224.0.0.0/4Multicast

Subnetting on the exams

Subnetting appears on both major networking certifications. Use the calculator to check your work, but practice doing it by hand and do not rely on a calculator in the exam.

Last updated October 30, 2026. CertSharp is a practice-exam provider. The formulas and worked example on this page follow the standard IPv4 addressing rules (RFC 4632 for CIDR, RFC 3021 for /31 links, RFC 1918 for private ranges), and the 10.1.1.77/26 example was verified with a script. The cheat sheet table is generated by the same code as the calculator. The explanations are written by CertSharp, not taken from vendor documentation, so confirm critical designs on your own equipment.

Subnet calculator FAQ

How do I calculate the number of usable hosts in a subnet?

Usable hosts = 2^(32 - prefix) - 2. The subtraction removes the network address (all host bits 0) and the broadcast address (all host bits 1). A /24 has 2^8 - 2 = 254 usable hosts and a /26 has 2^6 - 2 = 62. Two exceptions apply: a /31 has 2 usable addresses (RFC 3021 point-to-point links) and a /32 is a single host.

What is the difference between a subnet mask and a wildcard mask?

A subnet mask has 1 bits for the network portion and 0 bits for the host portion, for example 255.255.255.0. A wildcard mask is the bitwise inverse, 0.0.0.255, and is used in Cisco ACLs and OSPF network statements, where a 0 bit means "must match" and a 1 bit means "don't care".

What does /24 mean in an IP address?

The number after the slash is the prefix length: how many leading bits of the address identify the network. /24 means the first 24 bits are the network and the remaining 8 are for hosts, which equals the subnet mask 255.255.255.0 and gives 256 addresses.

What is VLSM and why use it?

Variable-length subnet masking lets you carve one address block into subnets of different sizes so each gets about the space it needs. Allocate the largest requirement first, then the next largest, so every block stays aligned and nothing overlaps. It wastes far fewer addresses than giving every subnet the same size.

Does this subnet calculator support /31 and /32?

Yes. A /31 is treated as a point-to-point link with two usable addresses and no broadcast, as RFC 3021 describes. A /32 is a single host route with one address. Most online calculators and many exam questions simplify these, so check the note shown with your result.

Where can I find a subnetting cheat sheet?

The cheat sheet section on this page lists the subnet mask, wildcard mask, block size, total addresses and usable hosts for every prefix from /8 to /32, plus the nine possible mask octet values and the three-step method for finding the network, broadcast and host range by hand.

How can I practice subnetting?

Use the free subnetting practice trainer: it generates random network address, broadcast, first and last host, usable host count, mask and prefix questions at three difficulty levels and shows the block-size working for every answer. Do each problem on paper first, then check it.

Is my data sent to a server?

No. All calculations run in your browser using plain JavaScript, so the addresses you type are never uploaded, stored or logged by CertSharp.

Practice subnetting under exam conditions

Try 30 free questions per session in practice mode for CCNA or Network+, or unlock the full 500-question bank and timed exam mode for $11.99 one-time per certification.