elefcode

Subnet Calculator

Work out the network, broadcast, mask and usable host range for any IPv4 or IPv6 block.

Network

Network address192.168.1.0/24
Netmask255.255.255.0
Wildcard mask0.0.0.255
Broadcast192.168.1.255
First host192.168.1.1
Last host192.168.1.254

Details

Prefix/24
Total addresses256
Usable hosts254
ClassC
ScopePrivate (RFC 1918)

Binary

Address11000000.10101000.00000001.10000010
Netmask11111111.11111111.11111111.00000000

The ones in the netmask mark the network portion; the zeros are host bits.

Split into smaller subnets

Advertisement

Guide

About the Subnet Calculator

A subnet calculator answers the question every network change starts with: given this address and this prefix, which addresses are actually in the block? Enter something like 192.168.1.130/24 and you get the network address, the broadcast, the first and last usable host, and how many hosts fit.

It accepts CIDR notation, a dotted netmask (10.0.0.1 255.255.255.0), or a bare address, and handles IPv6 as well as IPv4.

What the prefix actually means

The number after the slash is how many bits belong to the network. A /24 fixes the first 24 bits, leaving 8 bits for hosts — so 256 addresses, of which 254 are usable once the network and broadcast addresses are set aside. Every bit you add to the prefix halves the block. The binary view on this page shows exactly where that boundary falls, which is usually the clearest way to see why an address is or is not in a subnet.

Why usable hosts is two fewer

In a normal IPv4 subnet the first address identifies the network itself and the last is the broadcast address, so neither can be assigned to a machine. That is where the "minus two" comes from. There are two exceptions this calculator handles: a /32 is a single host route with no network or broadcast, and a /31 is a point-to-point link where both addresses are usable, as defined in RFC 3021.

Netmask, wildcard, and where each is used

The netmask (255.255.255.0) marks network bits with ones. The wildcard mask is its exact inverse (0.0.0.255) and is what Cisco access lists and OSPF statements expect. They carry the same information inverted, which is why mixing them up is such a common and confusing mistake.

Splitting a block

Choosing a longer prefix splits the block into equal subnets — a /24 divides into four /26s, each with 62 usable hosts. This is the usual way to carve an allocation into per-VLAN or per-environment ranges. The list is capped at 1,024 subnets, since beyond that a flat list stops being useful.

IPv6 differences

IPv6 has no broadcast address and no reason to reserve the first and last address, so every address in a prefix is usable. Allocations are also enormous: a single /64 holds about 18 quintillion addresses, and /64 is the standard size for one network segment. The calculator shows both the compressed form (RFC 5952) and the fully expanded form.

How to use it

  1. 1Type an address with a prefix, such as 10.0.0.0/8 — or paste an address and netmask separated by a space.
  2. 2Read the network, broadcast, and usable host range.
  3. 3Check the binary view to see exactly where the network boundary sits.
  4. 4Pick a longer prefix to split the block into equal subnets, and copy the list.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 contains 256 addresses, but the first is the network address and the last is the broadcast address, so neither can be assigned to a host.

What is the difference between a netmask and a wildcard mask?

They are exact inverses. A netmask like 255.255.255.0 marks network bits with ones; the wildcard 0.0.0.255 marks host bits with ones. Cisco ACLs and OSPF use wildcard masks.

Why does a /31 show two usable hosts?

RFC 3021 allows /31 on point-to-point links, where there is no need for a network or broadcast address, so both addresses can be assigned.

Does this work for IPv6?

Yes. Enter something like 2001:db8::/32 and you get the network, first and last address, total count, scope, and both the compressed and expanded forms.

Is my data sent anywhere?

No. All the arithmetic happens in your browser — nothing is uploaded, logged, or stored.

Related tools