NetDetectHubGet the app

Home / Tools

Subnet calculator

Type an address with a prefix or a mask and get the network, the usable host range, the broadcast address and the mask in binary. It also splits a block into equal subnets and handles IPv6. Everything runs in your browser.

Try:

How to use it

  1. In IP address with prefix or mask, type 192.168.1.0/24, 10.0.0.17 255.255.240.0 or an IPv6 prefix such as 2001:db8::/48.
  2. Optionally pick a smaller subnet size in Split into (optional), such as /26.
  3. Press Calculate.
  4. Press Copy as text for your notes, or Copy link to share the same calculation.

Worked example: 10.0.0.17 255.255.240.0

The mask 255.255.240.0 has 20 one-bits, so it's a /20. In binary it reads 11111111.11111111.11110000.00000000: the first 20 bits name the network and the last 12 number the hosts, giving 2 to the power 12 = 4,096 addresses.

  • Network address: 10.0.0.0 (all host bits 0)
  • First usable: 10.0.0.1 and Last usable: 10.0.15.254
  • Broadcast address: 10.0.15.255 (all host bits 1)
  • Wildcard mask: 0.0.15.255, the mask inverted, as some router and firewall rules expect
  • Usable hosts: 4,094, the total minus the network and broadcast addresses

Because 10.0.0.17 isn't the first address of its block, the result adds a note that the network is 10.0.0.0/20. The address lies in 10.0.0.0/8, one of the three private ranges in RFC 1918, so it's labelled a private network.

IPv4 CIDR cheat sheet

Common prefix lengths
PrefixSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/12255.240.0.01,048,5761,048,574
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/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

Each extra bit halves the block. A /31 has two usable addresses because RFC 3021 lets point-to-point links treat both as hosts, with no network or broadcast address. A /32 is a single host.

Splitting a block into subnets

Choose a longer prefix in Split into (optional) and the tool lists every subnet with its first, last and broadcast address. Splitting 10.0.0.0/20 into /22 gives 2 to the power (22 − 20) = 4 subnets of 1,022 usable hosts each: 10.0.0.0/22, 10.0.4.0/22, 10.0.8.0/22 and 10.0.12.0/22.

The list stops at the first 256 rows: a /16 split into /28 makes 4,096 subnets, and the page says it's showing the first 256. A split size shorter than the block's own prefix is ignored. Splitting works for IPv4 only.

IPv6 prefixes

IPv6 addresses are 128 bits, written as eight groups of four hex digits, with one run of zero groups shortened to ::. The result shows the address Written out in full, the network, the first and last address and the total count. IPv6 has no broadcast addresses; multicast does that job (RFC 4291). For almost all unicast addresses the interface ID is 64 bits, which is why one LAN is normally a /64.

Example: 2001:db8::/48 holds 2 to the power 80 addresses, and /64 networks inside shows 65,536: the 16 bits between /48 and /64.

Special ranges it recognises

Labels shown for reserved IPv4 ranges
RangeLabel in the result
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private network (RFC 1918)
100.64.0.0/10Carrier-grade NAT, shared address space (RFC 6598)
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24Documentation, TEST-NET-1 to 3 (RFC 5737)
127.0.0.0/8Loopback (this computer)
169.254.0.0/16Link-local (no DHCP answer)

Questions

Why are two addresses subtracted from every subnet?
The first address (host bits all 0) names the network and the last (host bits all 1) is the broadcast address, so devices can't use them. /31 and /32 are the exceptions.
Is a subnet mask the same as a prefix?
Yes, in two notations: /24 means 24 one-bits, written 255.255.255.0. The tool accepts both. A mask with gaps, such as 255.0.255.0, is rejected because CIDR masks must be one unbroken run of ones.
Which prefix fits 50 devices?
A /26, with 62 usable addresses. A /27 has only 30.
Is anything sent to a server?
No. The calculation runs entirely in your browser.
Does splitting work for IPv6?
Not here: Split into (optional) works for IPv4 only. For IPv6 the result shows how many /64 networks fit. To check who holds a public block, use the IP lookup.

Sources ·

Results come from public DNS, registry and certificate data and from checks run from Cloudflare's network at the moment you ask. They can differ from what another network sees. How our tools work · Terms of use.