IPv4 Subnet Calculator

Calculate IPv4 network address, subnet mask, wildcard, broadcast, and usable host range from CIDR notation. Supports /0 to /32 subnetting.

Loading tool module...

About this ipv4 subnet calculator

Calculate IPv4 network, mask, broadcast, host range and address counts for prefixes /0 through /32, including /31 point-to-point links.

How this tool works

For prefix p, construct a 32-bit mask with p leading one bits. Network = address AND mask; wildcard is the bitwise inverse of the mask; the upper boundary is network OR wildcard. The block contains 2^(32 − p) addresses. For /0 through /30, the displayed traditional usable count subtracts two and excludes the network and broadcast endpoints. For a /31 point-to-point link, RFC 3021 uses both endpoints without a directed broadcast. A /32 host route contains one address.

  1. Enter 192.168.1.42 in IPv4 address and 24 in CIDR prefix.
  2. Read all eight output fields; calculations update immediately.
  3. Copy copies 192.168.1.0/24. Load sample changes the input address to 192.168.1.100; Reset restores 192.168.1.42 and 24.

Worked example

Scenario: Check the boundary and traditional host capacity of 192.168.1.42/24.

Sample input:

IPv4 address: 192.168.1.42 CIDR prefix: 24

Processing: With /24, 24 bits belong to the network and eight to hosts. AND with 255.255.255.0 gives 192.168.1.0; 2^8 = 256 addresses, of which 254 are counted as traditional hosts.

Illustrative output:

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

Limits and verification

Accepts one dotted-decimal IPv4 address and an integer prefix from 0 to 32 in separate fields. Rejects leading-zero octets, octets above 255, IPv6, CIDR text in the address field and subnet-mask text in the prefix field. Counts describe block arithmetic, not whether every address is operationally assignable; reserved ranges and router/provider rules need separate checks. There is no VLSM planner, DNS record generator, router discovery, file input or download.

Examples demonstrate an expected workflow; they do not prove every input or every branch of an external specification. Check important results with an independent source before using them for money, security, compliance, safety, or irreversible file changes.

Browser processing boundary

Tool input is processed by code running in the browser and is not intentionally sent to a CZOA processing API. The page can still request ordinary site assets, analytics, or advertising when those services are enabled. Browser extensions and managed-device software remain outside this tool's control.

Relevant references

These references govern or help explain the format, protocol, or calculation used here. Listing a reference does not claim certification or complete implementation of every optional feature.

Content owner: CZOA Tools · Review methodology

How to use it

  1. Enter 192.168.1.42 in IPv4 address and 24 in CIDR prefix.
  2. Read all eight output fields; calculations update immediately.
  3. Copy copies 192.168.1.0/24. Load sample changes the input address to 192.168.1.100; Reset restores 192.168.1.42 and 24.

Frequently asked questions

Why do /31 and /32 have different usable-address rules?+

For /0 through /30 the calculator subtracts network and broadcast endpoints. RFC 3021 permits both addresses of a /31 as point-to-point endpoints, without directed broadcast. A /32 is one host route. These results do not verify device or provider support.

Which IPv4 and prefix input formats are accepted?+

Enter four decimal octets from 0 to 255, without leading zeros, and a separate whole-number prefix from 0 to 32. IPv6, negative or fractional prefixes, dotted masks and an address containing /24 are rejected. The calculator does not read a network configuration file.

What are the network, wildcard and address-count formulas?+

The prefix creates a mask with leading one bits. Network is the address AND that mask; wildcard inverts its 32 bits. Network OR wildcard gives the upper boundary. The total count is 2^(32 − prefix); usable counts follow the displayed /31 and /32 exceptions.

What do Copy, Load sample and Reset do?+

Copy places the canonical network/prefix in the clipboard, such as 192.168.1.0/24. Load sample sets 192.168.1.100 and 24; Reset restores 192.168.1.42 and 24. Clipboard permission can be denied. These actions do not inspect or modify routers, firewall rules or DNS records.