English

IPv4 Subnet Calculator — CIDR and Host Range

Calculate IPv4 network boundaries, masks and usable host ranges

Runs in your browser · nothing is uploaded

/31 treats both addresses as point-to-point endpoints; /32 represents one host. Reserved and private addresses are not checked for public routability.

Subnet calculation result: 192.168.1.0/24

Network address
192.168.1.0
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Broadcast address
192.168.1.255
First usable address
192.168.1.1
Last usable address
192.168.1.254
Total addresses
256
Usable hosts
254
Network CIDR
192.168.1.0/24

How to use

  1. Enter a dotted-decimal IPv4 address, such as 192.168.1.42.
  2. Enter its CIDR prefix length as an integer from 0 to 32. Keep the slash and prefix out of the address field.
  3. Read the network, mask, broadcast and usable host range.
  4. Copy the results into a configuration note or subnet planning document.

Calculation rules

An IPv4 address contains 32 bits. A prefix of /n reserves n bits for the network and leaves 32-n bits for addresses. The total address count is 2^(32-n). The subnet mask has ones in the network positions; the wildcard mask has the opposite bits.

For prefixes from /0 through /30, the network and broadcast addresses are excluded from the usable host count. For /31, both addresses are treated as point-to-point endpoints. For /32, the result is a single host address. These are arithmetic conventions; they do not test support on a particular router or operating system.

Examples

Address and prefix Network Usable range
192.168.1.42 /24 192.168.1.0/24 192.168.1.1–192.168.1.254
10.0.0.3 /31 10.0.0.2/31 10.0.0.2–10.0.0.3
203.0.113.7 /32 203.0.113.7/32 One address: 203.0.113.7

Input limits and interpretation

Each octet must be a decimal integer from 0 to 255. Leading-zero forms such as 01.2.3.4, hostnames and IPv6 are rejected to avoid ambiguous interpretation. A /0 covers the entire IPv4 address space mathematically, but its host count is not a count of assignable public addresses.

Before applying a network change, account for your gateway, DHCP allocation, reserved addresses and existing routes. This calculator does not inspect those settings.

The /31 point-to-point convention is described in RFC 3021.

FAQ

How are /31 and /32 networks handled?

A /31 is treated as a point-to-point link with two usable endpoints. A /32 represents a single host. Neither is shown with a broadcast address.

Does this check whether an address is publicly routable?

No. It calculates subnet boundaries only. Private, multicast and reserved address ranges are not classified, and the result is not a check of your router or network configuration.

Does the calculator contact the IP address?

No. It performs arithmetic in your browser without contacting the address or scanning the network.

Missing a tool?