Skip to content
CalculatorAtlas

IP Subnet Calculator

Tested

IPv4 network, broadcast, mask and host range from an address and CIDR prefix.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Enter an IPv4 address and a CIDR prefix and the calculator returns the network address, subnet and wildcard masks, broadcast address, first and last usable host and the number of usable hosts. The network address is the address AND the mask, the broadcast address is the network OR the inverted mask, and usable hosts are 2^(32 − prefix) − 2.

The prefix length is the number of leading bits that identify the network; the remaining bits identify hosts. This page handles IPv4 only; IPv6 uses a different address length and is not supported.

Related tools: Download Time Calculator: Time to download a file at a given speed. Bandwidth Calculator: Bandwidth needed to move a file in a given time. Data Transfer Calculator: Amount of data moved at a speed over a time.

How to use the IP Subnet Calculator

  1. Type iPv4 address, for example 192.168.1.130.
  2. Enter cIDR prefix length (a whole number, between 0 and 32). It starts at 24.
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the IP Subnet Calculator
InputWhat to enterAllowed values
IPv4 addressText, such as 192.168.1.130—
CIDR prefix lengthA whole number≥ 0, ≤ 32, starts at 24

Formula and method

Formula

network = address AND mask; broadcast = network OR NOT mask; hosts = 2^(32 − prefix) − 2

IEEE-754 double precision; shown to at most 6 decimal places.

/31 (point-to-point, RFC 3021) has 2 usable hosts and /32 has 1.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: IPv4 address = 192.168.1.130; CIDR prefix length = 26.

Results of example 1
ResultValue
Network192.168.1.128/26
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Broadcast192.168.1.191
First host192.168.1.129
Last host192.168.1.190
Usable hosts62

Example 2

Inputs: IPv4 address = 10.0.0.1; CIDR prefix length = 8.

Results of example 2
ResultValue
Network10.0.0.0/8
Subnet mask255.0.0.0
Wildcard mask0.255.255.255
Broadcast10.255.255.255
First host10.0.0.1
Last host10.255.255.254
Usable hosts16,777,214

Example 3

Inputs: IPv4 address = 10.1.1.1; CIDR prefix length = 32.

Results of example 3
ResultValue
Network10.1.1.1/32
Subnet mask255.255.255.255
Wildcard mask0.0.0.0
Broadcast10.1.1.1
First host10.1.1.1
Last host10.1.1.1
Usable hosts1

The first line is the headline result (network). Below it the iP Subnet Calculator lists subnet mask, wildcard mask, broadcast, first host, last host and usable hosts, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

Reading the result

For 192.168.1.130/26 the mask is 255.255.255.192, so the block size is 64 and the address falls in the block 192.168.1.128 to 192.168.1.191. The network address is 192.168.1.128, the broadcast address 192.168.1.191 and the usable hosts run from .129 to .190: 64 − 2 = 62.

Two addresses in every ordinary subnet are reserved: the network address and the broadcast address. The exceptions are /31, which RFC 3021 allows for point-to-point links with 2 usable addresses, and /32, which is a single host.

Usable hosts by prefix length

Usable hosts by prefix length
PrefixSubnet maskUsable hosts
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

Common mistakes

  • Assigning the network or broadcast address to a device.
  • Forgetting that the host count excludes those two addresses.
  • Mixing up the subnet mask (ones for the network) with the wildcard mask (the inverse), which routers and access lists often use.
  • Assuming 192.168.x.x, 10.x.x.x and 172.16-31.x.x are public: they are the private ranges in RFC 1918.

192.168.1.130 at different prefix lengths

Every figure in this table comes from running this calculator, so it matches what the form returns.

192.168.1.130 at different prefix lengths
PrefixNetworkBroadcastUsable hosts
24192.168.1.0/24192.168.1.255254
25192.168.1.128/25192.168.1.255126
26192.168.1.128/26192.168.1.19162
27192.168.1.128/27192.168.1.15930
28192.168.1.128/28192.168.1.14314

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • IPv4 address: entering "300.1.1.1" shows "Enter a valid IPv4 address such as 192.168.1.10." beside that field and no result.
  • CIDR prefix length: entering "33" shows "CIDR prefix length must be at most 32." beside that field and no result.

Choosing between the IP Subnet Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the IP Subnet Calculator and similar calculators
CalculatorYou enterIt returns
[Download Time Calculator](/technology/download-time-calculator/)file size, size unit and connection speedTime
[Bandwidth Calculator](/technology/bandwidth-calculator/)data size, size unit and time allowedBandwidth required
[Data Transfer Calculator](/technology/data-transfer-calculator/)speed, speed unit and durationData transferred
[Latency to Distance Calculator](/technology/latency-to-distance-calculator/)round-trip latency and signal speed as a fraction of cApproximate distance
[Network Throughput Calculator](/technology/network-throughput-calculator/)tCP window size and round-trip timeMaximum throughput

Background: networking and display

Network speeds are quoted in bits per second and file sizes in bytes, and a byte is 8 bits, so a 100 Mbps link moves at most 12.5 megabytes per second; real throughput is usually below the advertised rate. Pixel density is the diagonal in pixels divided by the diagonal in inches: a 1920×1080 display of 24 inches is about 92 pixels per inch, and a 3840×2160 display of 27 inches about 163.

Assumptions and limitations

  • Prefix 0–32
  • Octets 0–255

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for iPv4 address and cIDR prefix length to confirm this.

Frequently asked questions

Why are two addresses subtracted from the host count?

The first address of a subnet is the network address and the last is the broadcast address; neither can be assigned to a device, so usable hosts are 2^(32 − prefix) − 2.

Does this calculator support IPv6?

No. It works on IPv4 addresses with prefixes from 0 to 32.

What does the IP Subnet Calculator calculate?

IPv4 network, broadcast, mask and host range from an address and CIDR prefix. It returns Network, Subnet mask, Wildcard mask, Broadcast and First host.

What formula does the IP Subnet Calculator use?

network = address AND mask; broadcast = network OR NOT mask; hosts = 2^(32 − prefix) − 2. /31 (point-to-point, RFC 3021) has 2 usable hosts and /32 has 1.

What do I need to enter in the iP Subnet Calculator?

You enter IPv4 address and CIDR prefix length.

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Prefix 0–32.

What are the limits of this calculator?

Prefix 0–32. Octets 0–255.

What is an example of a iP Subnet result?

With iPv4 address 192.168.1.130 and cIDR prefix length 26, the network is 192.168.1.128/26.

Where does the method come from?

The method follows: RFC 4632 (CIDR); RFC 3021 (/31 networks).

Sources

  • RFC 4632 (CIDR)
  • RFC 3021 (/31 networks)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.