Skip to content

Prefix length from 0 to 32

Calculate an IPv4 subnet

A prefix says how many leading bits are the network. This page applies that mask to an IPv4 address and lists the addresses at the ends of the block.

The network is the address with the host bits cleared. The broadcast has those bits set. For a prefix of 30 or less, the first and last usable addresses sit inside the ends. A /31 has two usable addresses and no separate broadcast, and a /32 is a single address. The wildcard is the inverse of the mask. The page does not look up who owns the range.

The arithmetic stays in this tab.

This tool runs in your browser. Turn on JavaScript to use it.

A common LAN prefix

192.168.1.10/24 sits in a block of 256 addresses. Two of them are the ends.

Input
192.168.1.10/24
Network
192.168.1.0
Usable
254

How to use it

  1. 1Enter an IPv4 address.
  2. 2Set the prefix from 0 to 32.
  3. 3Read the network, mask, and range.

Good to know

  • IPv4 only.
  • /31 and /32 do not subtract two reserved addresses.
  • No registry lookup.

Questions

Why is /31 different?

Point-to-point links use both addresses. There is no separate network and broadcast to exclude.

Can I enter IPv6?

No. This page is for IPv4.

Does 192.168.1.10/24 change the host bits?

The network address clears them. The address you typed can sit anywhere in the block.

Related tools

  • Split a URL into parts

    A URL is several fields joined by punctuation. This page uses the browser's URL parser and lists each part, including every query parameter.

  • Look up an HTTP status

    Status codes are grouped by the first digit. This page lists the ones that show up in APIs and browsers, with a one-line meaning.

  • Convert binary, octal, decimal, and hex

    255, 0xFF, and 11111111 are one integer written three ways. This page keeps that integer exact and shows the other spellings beside the field you edit.