Skip to main content

Subnet Calculator

Use this subnet calculator to turn an IP address and a prefix (CIDR) or a netmask into the network address, the broadcast address, the first and last usable host, and the number of addresses. It works with IPv4 and IPv6.

The calculation runs in your browser. Nothing you enter is sent to Uptrack.

Try an example

Subnet calculator: what each result means

Network address
The first address of the block. It names the network and is not given to a host.
Broadcast address
The last address of an IPv4 block. A message sent to it reaches every host in the block.
First and last usable
The range of addresses you can give to hosts.
Netmask and wildcard mask
The netmask has ones for the network part and zeros for the host part. The wildcard mask is the reverse. Access lists often use it.

CIDR notation and the subnet mask

CIDR notation writes a network as an address and a prefix length, for example 192.168.1.0/24. The number after the slash tells how many bits, counted from the left, belong to the network. In 192.168.1.0/24 the first 24 bits are the network, so the netmask is 255.255.255.0 and 8 bits are left for hosts.

Each extra bit in the prefix halves the block. A /24 holds 256 addresses, a /25 holds 128 and a /26 holds 64.

IPv4 subnet sizes from /24 to /32

/24
256 addresses, 254 usable. The usual size of a small office network.
/26
64 addresses, 62 usable.
/28
16 addresses, 14 usable.
/30
4 addresses, 2 usable. Used for links between two routers.
/31
2 addresses, both usable, on a point-to-point link (RFC 3021).
/32
One address. It names a single host.

Frequently asked questions

What is a subnet mask?

A subnet mask is a 32-bit number that splits an IPv4 address into a network part and a host part. The ones mark the network part. 255.255.255.0 has 24 ones, so it is the same as /24.

How many hosts are in a /24 network?

A /24 has 256 addresses. Two are kept, the network address and the broadcast address, so 254 can be given to hosts.

Why are two addresses not usable in an IPv4 subnet?

The first address names the network and the last one is the broadcast address. A host cannot use either. A /31 link between two routers is the exception, and a /32 holds a single host.

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

They are opposites. A netmask has ones for the network part. A wildcard mask has ones for the part that may change. The wildcard mask of 255.255.255.0 is 0.0.0.255.

How does IPv6 subnetting differ from IPv4?

IPv6 addresses have 128 bits and the prefix is written the same way, for example 2001:db8::/32. There is no broadcast address, so every address in a block can be used, and a /64 is the usual size of one network.

Monitor this server every minute

Uptrack checks your site or service on a schedule and alerts you when it stops answering.

Plans from $3/mo, with a 30-day money-back guarantee.

HumanMachine