Skip to content
Test versionSearch

Developer tools

IPv4 subnet and CIDR arithmetic

Find the 32-bit mask, address interval and explicitly selected host convention for a strict dotted-decimal IPv4 address.

How it worksFAQRelated tools

Content reviewed:

The example values can be changed. Press Calculate to update the result; you can download it as TXT or CSV and collect scenarios in this tab. JSON, HTML and TXT downloads keep your inputs and all result rows, with exact values where available. Automatic recalculation after editing is off unless you switch it on. Nothing is saved, imported or sent automatically.

Arithmetic only, no address allocation, private/public classification or reachability check. Leading-zero octets and shorthand rejected. /31 endpoints only in point-to-point mode; /32 denotes one address.

Decimal results are approximate. Inputs stay in this browser tab.

How it works

Strict IPv4/CIDR, exact SI/binary transfer arithmetic or local URL/text rules; explicit conventions and bounded inputs. Arithmetic only, no address allocation, private/public classification or reachability check. Leading-zero octets and shorthand rejected. /31 endpoints only in point-to-point mode; /32 denotes one address.

Worked example

With these example values the calculator gives the result below. You can change any value in the form above.

Inputs

IPv4 address
192.168.1.10
CIDR prefix 0–32
24
Host interpretation for /31
Conventional subnet convention

Result

Entered IPv4
192.168.1.10
CIDR prefix
24
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
First/network address
192.168.1.0
Last address
192.168.1.255
Total addresses
256
Hosts under selected convention
254
First host or none
192.168.1.1
Last host or none
192.168.1.254
Directed broadcast or none
192.168.1.255

Frequently asked questions

How do I calculate an IPv4 subnet from CIDR?

Enter a strict dotted-decimal IPv4 address and a CIDR prefix from 0 to 32. The tool gives the subnet and wildcard masks, first and last address, total addresses and host range.

How are hosts counted in a conventional IPv4 subnet?

For /0 to /30, conventional hosts exclude the first and last address. The result shows the host count, first host and last host under the selected convention.

How are /31 and /32 handled?

A /31 uses both endpoints only if point-to-point mode is selected. A /32 denotes one address.

What IPv4 formats are rejected?

Leading-zero octets and shorthand are rejected.

What is the default IPv4 example?

The editable example is address 192.168.1.10 with prefix 24 and the conventional host mode.

Does the tool check reachability?

No. It is arithmetic only, with no address allocation, private or public classification, routing or reachability check.