~/jackwent.co.uk
jack@jackwent:~$ ./subnet-calc

Subnet Calculator for IPv4 and IPv6

built by updated 24 October 2026

Type an IP address with its prefix (192.168.1.10/24) or its mask (192.168.1.10 255.255.255.0) and everything updates as you type. It all runs in your browser, so nothing you enter is sent anywhere. The address bar updates too, so you can bookmark or share a result.

jack@jackwent: ~/tools/subnet-calcIPv4
Network
192.168.1.0/24
Usable hosts
192.168.1.1 to 192.168.1.254
Broadcast
192.168.1.255
Host count
254 usable 256 addresses in total
Subnet mask
255.255.255.0 (/24)
Wildcard mask
0.0.0.255
Address type
Private (RFC 1918) class C
IP in hex
0xC0A8010A
Binary
11000000.10101000.00000001.00001010

Split this network

#NetworkUsable rangeBroadcast

Size subnets by hosts needed (VLSM)

Biggest first, each one the smallest subnet that fits, packed into the network above.

NeededSubnetUsable rangeUsable

How to read the results

  • Network is the first address in the subnet. It identifies the subnet itself, so you can’t give it to a device.
  • Usable hosts is the range you can actually hand out to PCs, printers and servers.
  • Broadcast is the last address. Anything sent there goes to every device on the subnet, so it can’t be used either.
  • Wildcard mask is the mask flipped over. Cisco access lists and OSPF use it instead of the subnet mask.
  • Binary shows the network bits in amber and the host bits in blue. The prefix is simply how many amber bits there are.

That’s why a /24 has 256 addresses but only 254 usable hosts: one goes on the network address and one on the broadcast.

Worked example: 192.168.1.130/26

A /26 leaves 6 host bits, so each subnet is 64 addresses: .0, .64, .128 and .192. The address .130 falls in the third block, which gives:

ResultValue
Network192.168.1.128
Usable hosts192.168.1.129 to 192.168.1.190 (62 hosts)
Broadcast192.168.1.191
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Total addresses64

Type 192.168.1.130/26 into the calculator above and you’ll get the same numbers. To practise working them out in your head, try the daily Subnetle puzzle.

Under Split this network, pick a smaller size to carve the network up. Copy table puts the list on your clipboard ready to paste into a spreadsheet, and download CSV saves it as a file, up to 4,096 subnets at a time.

If your subnets need different sizes, type how many hosts each one needs under Size subnets by hosts needed, for example 100, 50, 20, 2. That’s VLSM: it gives the biggest one the first block, each one the smallest subnet that fits, and tells you what’s left.

The exceptions: /31 and /32

A /31 has just two addresses and no network or broadcast address, so both are usable. That’s perfect for a link between two routers and saves wasting a whole /30 (RFC 3021).

A /32 is a single address. You’ll see it for loopback addresses on routers, and in firewall rules that match one host.

CIDR cheat sheet

PrefixSubnet maskAddressesUsable hostsTypical use
/8255.0.0.016,777,21616,777,214The whole 10.x.x.x private range
/16255.255.0.065,53665,534A large site or campus
/20255.255.240.04,0964,094A big Wi-Fi network
/22255.255.252.01,0241,022A busy office floor
/23255.255.254.0512510A medium office
/24255.255.255.0256254Nearly every home network
/25255.255.255.128128126Half a /24
/26255.255.255.1926462A small VLAN, like printers or CCTV
/27255.255.255.2243230Servers or management
/28255.255.255.2401614A small block of public IPs
/29255.255.255.24886The block of public IPs your ISP gives you
/30255.255.255.25242An old style point to point link
/31255.255.255.25422A modern point to point link
/32255.255.255.25511A single host

IPv6 subnets

IPv6 works the same way, with two differences: the addresses are 128 bits long and written in hex, and there’s no broadcast address, so every address in a prefix can be used. Type an address with its prefix, like 2001:db8:abcd::/48.

jack@jackwent: ~/tools/subnet-calc -6IPv6
Network
First address
Last address
Addresses
/64 networks
Address type
Full form

Split this prefix

#PrefixLast address

The sizes that matter in IPv6 are different too. Every LAN or VLAN should be a /64, however few devices it has, because SLAAC (how devices give themselves an address) needs 64 bits for the host part. Your ISP usually hands you a /56 (256 of those /64 networks) or a /48 (65,536 of them), so running out isn’t the worry it is with IPv4. fd00::/8 addresses are unique local addresses, the IPv6 version of the private ranges, and fe80:: is link-local, which every interface has and which never leaves the local network.

Private address ranges

These ranges are never routed on the internet, so you can use them freely inside your own network:

RangeCIDRNotes
10.0.0.0 to 10.255.255.25510.0.0.0/8Loads of room, popular in business networks
172.16.0.0 to 172.31.255.255172.16.0.0/12Often forgotten, and the one Docker likes to use
192.168.0.0 to 192.168.255.255192.168.0.0/16What almost every home router uses

Two more worth recognising: 100.64.0.0/10 is carrier-grade NAT, which means your ISP is sharing one public IP between lots of customers, and 169.254.x.x means a device asked for a DHCP address and didn’t get one.

Tips from the real world

  • Plan bigger than you need. A /24 for a VLAN with 30 devices feels wasteful, until you’re renumbering everything two years later.
  • Avoid 192.168.0.x and 192.168.1.x for anything that needs a VPN. Every home router uses them, so remote workers end up with clashing networks.
  • Keep subnets on clean boundaries. A /26 has to start on 0, 64, 128 or 192. The split tool above only ever gives you valid ones.
  • Write it down. A simple spreadsheet of subnets, VLANs and what lives where saves hours later.

Quick answers

How many usable hosts are in a /24?

254 usable hosts. A /24 has 256 addresses, and the first (the network address) and the last (the broadcast) can’t go on a device.

What’s the subnet mask for a /26?

255.255.255.192. It gives four subnets per /24, starting at .0, .64, .128 and .192, each with 62 usable hosts.

What’s the difference between a subnet mask and a wildcard mask?

They’re opposites. The mask has 1s for the network part (255.255.255.0), and the wildcard has 1s for the host part (0.0.0.255). Firewalls and routers mostly use the mask, while Cisco access lists and OSPF use the wildcard.

Why does IPv6 use a /64 for every network?

Devices build their own address from the network’s prefix plus 64 bits of their own, so anything smaller than a /64 stops automatic addressing from working. With 18 quintillion addresses in each /64, wasting them isn’t a problem.

For checking what’s actually on a network, the commands page has the ipconfig, arp and route commands that go hand in hand with this. If you work with RAM and disk sizes as well, there’s also a memory calculator. To check how long a big copy will take over your network, try the transfer time calculator, and the PoE budget calculator checks a switch can power your access points and cameras.

[jackwent]