Skip to content

Subnet Calculator

Works out the network address, usable range, mask and host count for any IPv4 or IPv6 block, and splits it into smaller subnets.

Your address stay on this device

This tool runs entirely inside your web browser. Your address are processed on your own device and are never sent to our servers. How this works

A prefix such as /24, a mask such as 192.168.1.10 255.255.255.0, or a plain address. IPv4 and IPv6 both work.

192.168.1.0/24 — IPv4

Network address
192.168.1.0
Usable range
192.168.1.1 – 192.168.1.254
Broadcast address
192.168.1.255
Usable addresses
254
Total addresses
256
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Prefix length
/24
Used for
Private — usable inside your own network, never routed on the internet

In binary

Address
11000000.10101000.00000001.00000000
Mask
11111111.11111111.11111111.00000000

The first 24 bits identify the network; the remaining 8 identify a host inside it.

Is an address inside this block?

Type an address to check it.

Split into smaller blocks

Enter a longer prefix, e.g. 26.

What size block do I need?

Enter how many machines need an address.

Subnet Calculator is a free tool that works out everything about an IP block: the network address, the usable host range, the broadcast address, the subnet mask and wildcard mask, and how many addresses it holds. It handles IPv4 and IPv6, splits a block into smaller ones, and tells you whether a given address falls inside it. All the arithmetic happens in your browser.

How to calculate a subnet

  1. Type a block such as 192.168.1.0/24, or any address inside it — the network address is worked out for you.
  2. Read the usable range: these are the addresses you can actually give to machines.
  3. To divide the block up, enter a longer prefix under “Split into smaller blocks”.
  4. To check a single address, type it under “Is an address inside this block?”.

What the prefix means

The number after the slash is how many bits at the start of the address identify the network. In192.168.1.0/24, the first 24 bits are the network and the remaining 8 identify a host, giving 256 addresses. Every bit you add to the prefix halves the block: a /25 holds 128 addresses, a /26 holds 64. The binary view on this page shows exactly where that line falls.

Why a /24 holds 254 usable addresses

IPv4 reserves two addresses in every block. The first names the network itself, and the last is the broadcast address for everything on it, so neither can be given to a machine. That is why a /24 offers 254 rather than 256, and a /30 — the smallest ordinary block — offers just 2 of its 4.

The exceptions: /31 and /32

A /31 has two usable addresses, not zero. Reserving a network and broadcast address in a four-address block wastes half of it, so RFC 3021 removed both for /31, which is now standard on point-to-point links between routers. A /32 is a single address: one host, one route, or one entry in a firewall rule. Calculators that apply the general rule everywhere report zero or minus one for these; this one does not.

IPv6 is different

IPv6 has no broadcast address, so every address in a block is usable. Blocks are enormous — a single /64 holds about 18.4 quintillion addresses — and /64 is used for almost every network regardless of how few machines are on it, because address autoconfiguration depends on it. A site is typically given a /48 or /56 to divide into /64s.

Private, public and special ranges

This page names what each address is set aside for. The private IPv4 ranges are 10.0.0.0/8,172.16.0.0/12 and 192.168.0.0/16; note that the middle one ends at 172.31.255.255, so 172.32.0.1 is a public address. On IPv6, fc00::/7 is the equivalent private range andfe80::/10 is link-local. Addresses in 192.0.2.0/24 and 2001:db8::/32 are reserved for documentation, which makes them safe to use in examples and screenshots.

Masks and wildcards

A subnet mask writes the same prefix as a dotted address: /24 is 255.255.255.0. Its bits must run together from the left, which is why 255.255.0.255 is not a valid mask. A wildcard mask is the mask with every bit flipped, used by Cisco access lists and some firewall rules, so /24 becomes 0.0.0.255. You can type either form into this page. For pulling apart a URL rather than an address, see theURL Parser.

Frequently asked questions

Why does a /24 have 254 usable addresses and not 256?

IPv4 reserves the first address of a block to name the network itself and the last as the broadcast address, so neither can be given to a machine. That leaves 254 of the 256.

Why does this say a /31 has two usable addresses?

Because it does. RFC 3021 removed the network and broadcast addresses for /31 blocks so that point-to-point links between routers stop wasting half of a four-address block. Calculators that report zero are using the general rule where it does not apply.

How many addresses does an IPv6 /64 have?

About 18.4 quintillion — 2 to the power of 64. IPv6 has no broadcast address, so every one of them is usable. Networks are almost always /64 regardless of how few machines are on them.

What is a wildcard mask?

The subnet mask with every bit flipped. Cisco access lists and some firewall rules are written with it, so a /24 appears as 0.0.0.255 rather than 255.255.255.0.

Is 172.32.0.1 a private address?

No. The private range is 172.16.0.0/12, which ends at 172.31.255.255, so 172.32.x.x is public. This catches people out often enough that this tool names the purpose of every address you enter.

Last updated

Missing a feature, or need a tool we don’t have? Suggest it.