IPv4 Subnet Calculator

Calculate an IPv4 network, mask, and usable host count from an address and a prefix length. Nothing is looked up.

Last updated: October 6, 2026

Tool

This tool will load here.

What this tool does

This IPv4 subnet calculator takes one IPv4 address and a prefix length from 0 to 32 and prints the network that contains that address. The address may be four dotted octets, or the same octets with a slash and a prefix. A separate prefix field is used when the address has no slash. If both are filled and the numbers differ, Calculate stops and clears the previous result.

The arithmetic is integer arithmetic on the 32-bit value. The mask is the top prefix bits. The network is the address AND the mask. The wildcard is the inverse of the mask. For prefixes 0 through 30, the broadcast is the network OR the wildcard, the first host is the network plus one, the last host is the broadcast minus one, and the usable host count is the total number of addresses minus 2. A /0 has 4294967296 addresses and 4294967294 usable hosts. Those counts are exact. They are not a rounded floating-point estimate.

A /31 is the exception in RFC 3021. Both addresses are usable, the usable count is 2, and the page does not print a broadcast row. A /32 is a single address. The network is that address, the usable count is 1, and there is no broadcast row.

The range line comes from a fixed list, checked in order: limited broadcast for 255.255.255.255, this network for 0.0.0.0/8, private for 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, shared address space for 100.64.0.0/10, loopback for 127.0.0.0/8, link-local for 169.254.0.0/16, documentation for 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24, multicast for 224.0.0.0/4, and reserved for 240.0.0.0/4. Any other address is labeled not in the special ranges on this page. That label is not a claim that the address is public, routed, reachable, or safe to use. The page does not say which network announced it.

How to use

  1. Type the address as four decimal octets, or as octets plus a slash and a prefix.
  2. If the address has no slash, type the prefix in the prefix field. The prefix is an integer from 0 to 32 with no leading zero.
  3. Choose Calculate, or press Enter in a field. Copy writes the lines you see. Clear empties both fields and the result.

An invalid address, a hostname, an IPv6 value, a prefix outside 0–32, or a slash that disagrees with the prefix field clears the table. The previous network does not stay on screen. Nothing is sent off the page.

Example

192.168.1.0/24 produces network 192.168.1.0, subnet mask 255.255.255.0, wildcard 0.0.0.255, broadcast 192.168.1.255, first host 192.168.1.1, last host 192.168.1.254, 256 total addresses, and 254 usable hosts. The range line is private. The same result appears if the address field is 192.168.1.0 and the prefix field is 24.

192.168.0.1/31 produces usable addresses 192.168.0.0 and 192.168.0.1, with a usable count of 2 and no broadcast line. 10.1.2.3/32 produces one usable address, 10.1.2.3. 8.8.8.8/0 produces network 0.0.0.0, broadcast 255.255.255.255, and the range line not in the special ranges on this page. 192.168.001.1 is rejected because of the leading zero. 2001:db8::1 is rejected because this page does not calculate IPv6. example.com is rejected because it is a hostname.

Limits

  • IPv4 only. One address. Prefix 0–32. No leading zero in an octet.
  • No DNS, WHOIS, geolocation, or reachability check.
  • /31 follows RFC 3021. /32 is one address. The range list is the list above and nothing else.

The calculation stays in the browser. The address is not stored. A result describes the prefix you typed. It does not tell you whether a host answers, which operator holds the space, or whether a packet would be delivered.

On this page

Related Articles

Related guides

Related solutions

Need another tool ?

Open the free tools — no signup.

FAQs

newsletter signup

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Innovative Solutions For Modern Needs
Copyright © 2026 Yallasolve. all rights reserved.