Clever Quest Lab Tools

Subnet Calculator

2026-10-06

Enter an IPv4 address with a prefix or a mask to get its network and broadcast address, usable host range, wildcard mask and a bit-by-bit breakdown. Then split the network into equal subnets or plan subnets of different sizes with VLSM.

Subnet details

Accepts 192.168.1.10/24, 192.168.1.10 255.255.255.0 or a bare address, which uses the prefix below.
Network
—

Network address
Broadcast address
First usable host
Last usable host
Usable hosts
Total addresses
Subnet mask
Wildcard mask
CIDR notation
Legacy class
Address type
Entered address
Address as integer
Address in hex

Binary breakdown

ValueNetwork bitsHost bitsDotted decimal

Everything is calculated in your browser — nothing you enter is sent to a server.

Split into equal subnets

Divides the network from the first card into subnets of one size.

Split by

#SubnetFirst hostLast hostBroadcastUsable hosts

VLSM planner

Fits subnets of different sizes into the network from the first card. List the hosts each subnet needs; the order does not matter.

NameHosts neededHosts availableSubnetMaskHost rangeBroadcast

Each subnet gets the smallest block with at least the needed usable hosts; the largest is placed first, so the blocks follow each other without gaps.

How to use the subnet calculator

  1. Type an IPv4 address into the first field. Add a prefix (192.168.1.10/24) or a dotted mask (192.168.1.10 255.255.255.0), or enter a bare address and choose the prefix below it. The selector and the mask field stay in sync.
  2. Read the result: network and broadcast address, usable host range, masks, class, address type, and the address as an integer, in hex and in binary.
  3. To split that network into equal parts, choose a new prefix, a number of subnets, or the hosts needed per subnet. The table shows the first 256 subnets; the CSV buttons export all of them, up to 65,536.
  4. To plan subnets of different sizes, list the hosts each one needs in the VLSM planner. Names are optional.
  5. Use the Copy buttons to paste values elsewhere.

How it works

An IPv4 address is a 32-bit number written as four decimal octets. The prefix length (/24) says how many leading bits identify the network; the remaining bits number the hosts inside it. A subnet mask carries the same information in address form: network bits are 1 and host bits are 0, so /24 is 255.255.255.0. The ones must be contiguous, which is why a mask such as 255.0.255.0 is rejected.

Two bitwise operations find the edges of a subnet: network = address AND mask and broadcast = network OR wildcard, where the wildcard is the inverted mask. Worked in binary for 10.0.5.130/26 (the bar marks the end of the 26 network bits):

address   10.0.5.130
00001010.00000000.00000101.10|000010
mask      255.255.255.192
11111111.11111111.11111111.11|000000
AND       network 10.0.5.128
00001010.00000000.00000101.10|000000
wildcard  0.0.0.63
00000000.00000000.00000000.00|111111
OR        broadcast 10.0.5.191
00001010.00000000.00000101.10|111111

AND keeps the network bits and clears the host bits; OR then sets every host bit to 1.

With h = 32 − prefix host bits, a subnet contains 2h addresses. The one with all host bits 0 is the network address, and the one with all host bits 1 is the broadcast address that reaches every device in the subnet. Neither can be assigned to a device, so the number of usable hosts is 2h − 2; for a /26 that is 64 − 2 = 62.

Equal split. Moving the prefix from p to a longer q turns q − p host bits into network bits and creates 2q − p subnets of the same size.

VLSM. Variable-length subnet masking gives each group a subnet sized for it instead of one size for all. The planner sorts the requirements from largest to smallest and gives each the smallest block whose 2h − 2 covers the hosts needed. Largest first works because every block size is a power of two and a block must start on a multiple of its own size: after a larger block, the next free address is already aligned for any smaller one, so the blocks follow each other without gaps.

All arithmetic is exact unsigned 32-bit integer arithmetic; nothing is rounded.

Examples

Example 1 — a home network. 192.168.1.10/24: network 192.168.1.0, broadcast 192.168.1.255, hosts 192.168.1.1 – 192.168.1.254 (254 usable), mask 255.255.255.0, wildcard 0.0.0.255. It is a private class C address; as an integer it is 3232235786, in hex C0A8010A.

Example 2 — a prefix inside an octet. 172.16.45.200/20: the mask is 255.255.240.0, so only the first four bits of the third octet belong to the network. 45 is 0010 1101; keeping 0010 gives 32. Network 172.16.32.0, broadcast 172.16.47.255, hosts 172.16.32.1 – 172.16.47.254, 4,094 usable.

Example 3 — equal split. 192.168.1.0/24 split into /26 gives 22 = 4 subnets: 192.168.1.0, .64, .128 and .192, each with 62 usable hosts. Asking for 50 hosts per subnet leads to the same /26, because a /27 holds only 30.

Example 4 — VLSM. In 192.168.1.0/24, groups of 100, 50, 25, 10 and 2 hosts receive 192.168.1.0/25 (126 hosts), 192.168.1.128/26 (62), 192.168.1.192/27 (30), 192.168.1.224/28 (14) and 192.168.1.240/30 (2). The addresses 192.168.1.244 – 192.168.1.255 (12) stay unallocated.

Subnet mask cheat sheet: /8 to /32

Each extra prefix bit halves the subnet.

PrefixSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/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

/31 and /32. The last two rows break the “minus two” rule. A /31 has only two addresses; RFC 3021 allows both to be used as hosts on a point-to-point link, where no broadcast address is needed. A /32 is a single address, used for one host in routing entries and filters. The calculator reports 2 and 1 usable addresses for them.

Wildcard mask. The wildcard mask is the subnet mask with every bit inverted (each octet is 255 minus the mask octet), so /24 gives 0.0.0.255. A 0 bit means “must match” and a 1 bit means “ignore”. Access control lists and some routing configurations expect this form instead of the mask.

Private and special address ranges

RFC 1918 reserves three blocks for private networks: 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 – 172.31.255.255) and 192.168.0.0/16. They are not routed on the public internet; hosts that use them reach it through address translation.

The calculator also recognises loopback (127.0.0.0/8), link-local (169.254.0.0/16, self-assigned when no address server answers), shared address space for carrier-grade translation (100.64.0.0/10), multicast (224.0.0.0/4), reserved (240.0.0.0/4), the documentation blocks 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, “this network” (0.0.0.0/8), protocol assignments (192.0.0.0/24), benchmarking (198.18.0.0/15) and the limited broadcast address 255.255.255.255. Everything else is labelled public.

The legacy class (A to E) depends only on the first octet: A is 0–127, B 128–191, C 192–223, D 224–239 and E 240–255. Classes were replaced by classless prefixes in 1993 and are shown for reference only.

Frequently asked questions

Why does a /24 have 254 hosts and not 256?

A /24 contains 256 addresses, but the first is the network address and the last is the broadcast address. Subtracting those two leaves 254 for devices.

How do I choose a prefix for a given number of hosts?

Add 2 to the host count, round up to the next power of two and count the host bits. For 50 hosts: 52 rounds up to 64 = 26, so 6 host bits and a prefix of 32 − 6 = /26. The “Hosts per subnet” mode and the VLSM planner do this for you.

Can I use the first and the last subnet of a split?

Yes. Old classful equipment avoided the all-zeros and all-ones subnets, but with classless routing every subnet in the table is usable.

Does the calculator support IPv6?

No. It covers IPv4 only. IPv6 addresses are 128 bits long, are written in hexadecimal and have no broadcast address, so they need a different tool.

Is anything I enter uploaded?

No. All calculations run in your browser. Your inputs are kept only in this browser's local storage; nothing is sent to a server.

Related tools