Subnet Calculator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free IPv4 subnet calculator. Enter an IP with a CIDR prefix or a subnet mask to get the network, broadcast, host range, usable hosts, wildcard and more.

Network
0
Broadcast
0
Usable hosts
0
Number of hosts
0
Subnet mask
0
Type
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the subnet calculator

Type an IPv4 address with its prefix length, such as 192.168.1.10/24. If you have a subnet mask instead of a prefix, type the address on its own and put the mask in the second box, such as 255.255.240.0. The subnet calculator instantly shows:

  • The network address and the subnet in CIDR notation.
  • The broadcast address.
  • The usable host range: the first and last addresses you can give to devices.
  • How many hosts the subnet can hold.
  • The subnet mask and wildcard mask.
  • The type of address: private, public, loopback, link-local, shared (carrier-grade NAT), multicast or reserved.
  • The mask in binary, so you can see exactly where the network part ends.

It also warns you if the address you typed is the network or broadcast address itself, which can't be given to a device. Everything is calculated in your browser.

IP addresses and subnets in plain English

An IPv4 address is 32 bits, written as four numbers from 0 to 255, such as 192.168.1.10. Every address has two parts:

  • The network part, shared by every device on the same subnet.
  • The host part, which identifies one device on that subnet.

The prefix length (the number after the slash) says how many bits belong to the network part. In 192.168.1.10/24, the first 24 bits (192.168.1) are the network, and the last 8 bits identify the host, so the subnet has 2⁸ = 256 addresses, from 192.168.1.0 to 192.168.1.255.

The subnet mask says the same thing another way: 24 ones followed by 8 zeros, written as 255.255.255.0. The subnet calculator accepts either.

Network, broadcast and usable addresses

In a normal subnet, two addresses are reserved:

  • The network address, the first one (all host bits 0), identifies the subnet itself. In 192.168.1.0/24, it's 192.168.1.0.
  • The broadcast address, the last one (all host bits 1), sends to every device on the subnet at once. Here it's 192.168.1.255.

Everything in between can be given to devices: 192.168.1.1 to 192.168.1.254, which is 254 usable hosts. That's why the number of usable hosts is the total minus 2.

There are two special cases:

  • /31 has just two addresses and no network or broadcast address: both are usable. It's used for point-to-point links between two routers, as described in RFC 3021.
  • /32 is a single address, used for one host, a loopback interface or a firewall rule that matches exactly one machine.

CIDR cheat sheet

Prefix Subnet mask Total addresses Usable hosts
/8 255.0.0.0 16,777,216 16,777,214
/16 255.255.0.0 65,536 65,534
/20 255.255.240.0 4,096 4,094
/22 255.255.252.0 1,024 1,022
/23 255.255.254.0 512 510
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2
/31 255.255.255.254 2 2 (point-to-point)
/32 255.255.255.255 1 1 (single host)

Each step down in prefix doubles the size of the subnet; each step up halves it.

Private and public addresses

Some address ranges are set aside for private networks, such as homes, offices and cloud networks. They're never routed on the public internet, so the same addresses can be reused in millions of places:

  • 10.0.0.0/8 (10.0.0.0 to 10.255.255.255)
  • 172.16.0.0/12 (172.16.0.0 to 172.31.255.255)
  • 192.168.0.0/16 (192.168.0.0 to 192.168.255.255)

The subnet calculator also recognises:

  • 127.0.0.0/8, loopback: the device talking to itself. 127.0.0.1 is "localhost".
  • 169.254.0.0/16, link-local: addresses a device gives itself when it can't reach a DHCP server. Seeing one usually means the network connection isn't working properly.
  • 100.64.0.0/10, shared address space: used by internet providers for carrier-grade NAT.
  • 224.0.0.0/4, multicast, and 240.0.0.0/4, reserved.

Anything else is shown as public.

The wildcard mask

The wildcard mask is the subnet mask with every bit flipped: 255.255.255.0 becomes 0.0.0.255. Cisco access control lists and OSPF configurations use wildcard masks to match ranges of addresses, so the subnet calculator shows it alongside the normal mask.

Address classes

Before CIDR was introduced in 1993, IPv4 addresses were divided into fixed classes: A (first number 0 to 127, default /8), B (128 to 191, /16), C (192 to 223, /24), D (224 to 239, multicast) and E (240 and up, reserved). Classes no longer decide how networks are sized, but they still appear in exams and older documentation, so the tool shows the class for reference.

Planning subnets

A few rules of thumb when you design a network:

Size for growth. If a team has 40 devices today, a /26 (62 hosts) fits, but a /25 (126 hosts) leaves room to double.

Keep subnets aligned. A /26 must start at a multiple of 64 in its last number: .0, .64, .128 or .192. The subnet calculator always shows the real network address, so if you type 10.0.5.77/26 it tells you the subnet is 10.0.5.64/26.

Separate by purpose. Put staff devices, guest Wi-Fi, servers, cameras and payment terminals in different subnets so problems and security risks stay contained.

Document everything. Keep a list of subnets, what they're for and which addresses are reserved for routers, printers and servers.

Avoid overlaps with VPNs and cloud networks. If your office uses 192.168.1.0/24 and a remote worker's home router uses the same range, a VPN between them can break. Picking a less common range, such as 10.37.0.0/16, avoids that.

Subnetting by hand

If you're studying for a networking exam, it helps to know how the subnet calculator gets its answers:

  1. Write the mask in binary. /26 is 26 ones followed by 6 zeros: 11111111.11111111.11111111.11000000, which is 255.255.255.192.
  2. Find the block size. In the last number of the mask that isn't 255, subtract it from 256: 256 − 192 = 64. Subnets start at multiples of 64: .0, .64, .128, .192.
  3. Find the network address. Take the largest multiple of the block size that isn't bigger than the address's number in that position. For 10.0.5.77/26, 77 lies between 64 and 128, so the network is 10.0.5.64.
  4. Find the broadcast address. One less than the next block: 10.0.5.127.
  5. Find the usable range. One after the network to one before the broadcast: 10.0.5.65 to 10.0.5.126.
  6. Count the hosts. 2 to the power of the host bits, minus 2: 2⁶ − 2 = 62.

The subnet calculator does the same steps with exact binary arithmetic, so you can use it to check your working.

Supernetting and summarising routes

The opposite of splitting a network is combining several into one bigger block, called summarising or supernetting. Four /24 networks, 192.168.0.0 to 192.168.3.0, can be described as a single 192.168.0.0/22, because a /22 covers 1,024 addresses starting at a multiple of 4 in the third number. Routers use summaries to keep their routing tables short. To check one, type the summary into the subnet calculator and confirm the first and last addresses cover all the smaller networks.

A worked example

A bakery is opening a second shop and its IT contractor is planning the network. The first shop uses 192.168.1.0/24. For the new shop, he wants separate subnets for staff devices (about 20), guest Wi-Fi (up to 50 phones) and the card terminals and printers (fewer than 10), all within 10.20.0.0/24.

He starts with the biggest: guest Wi-Fi needs 50 hosts, so a /26 (62 usable). He types 10.20.0.0/26 into the subnet calculator: network 10.20.0.0, broadcast 10.20.0.63, usable 10.20.0.1 to 10.20.0.62.

Staff devices need 20, so a /27 (30 usable). The next free block starts at .64: 10.20.0.64/27 gives 10.20.0.65 to 10.20.0.94, broadcast .95.

Terminals and printers need under 10, so a /28 (14 usable): 10.20.0.96/28 gives 10.20.0.97 to 10.20.0.110, broadcast .111.

Out of curiosity he types 10.20.0.100/27. The tool shows it belongs to 10.20.0.96/27, which overlaps his /28 plan, confirming he should stick with the /28 for that block. The rest of the /24, from .112 upwards, is kept for the future.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit is a Google Ads agency that does PPC and nothing else: we build the campaigns, block the searches that waste money, write the ads, set up conversion tracking and send you a short report every week. Request a free PPC audit and we will show you, in dollars, what we would fix first.

Other tools for technical work: the chmod calculator for Linux file permissions, the URL parser for web addresses and the binary translator for converting numbers and text to binary.

Frequently asked questions

How do I calculate a subnet?

Type the IP address with its prefix, such as 192.168.1.10/24, into this subnet calculator. It works out the network address, broadcast address, usable host range and number of hosts.

How many usable hosts are in a /24?

A /24 has 256 addresses. Two are reserved for the network and broadcast addresses, leaving 254 usable hosts.

What is CIDR notation?

CIDR notation writes a network as an address and a prefix length, such as 10.0.0.0/8. The prefix says how many bits at the start of the address belong to the network.

How do I convert a subnet mask to CIDR?

Count the 1 bits in the mask. 255.255.255.0 has 24, so it's /24; 255.255.240.0 has 20, so it's /20. The subnet calculator converts it for you if you type the mask in the second box.

Is 192.168.1.1 a private IP address?

Yes. Everything from 192.168.0.0 to 192.168.255.255 is private, as are 10.0.0.0/8 and 172.16.0.0/12.

Does this subnet calculator work with IPv6?

No, it's for IPv4 addresses only, which are still the most common in office and home networks.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep