← All calculators / Computing

IPv4 subnet

IPv4 only.

01 / Your inputsBrowser-only calculation
IPv4 subnet
—
How it works

The formula

Network = IP AND mask; broadcast = network OR inverted mask

Example inputs

IPv4 address: 192.168.1.42 · CIDR prefix: 24

Result: 192.168.1.0/24 · Mask: 255.255.255.0 · Broadcast: 192.168.1.255 · Usable hosts: 254 · Range: 192.168.1.1–192.168.1.254

What the IPv4 subnet works out

The IPv4 subnet turns the figures below into IPv4 subnet, using the formula Network = IP AND mask; broadcast = network OR inverted mask. IPv4 only.

What each field means

IPv4 address
Entered as text rather than a single number — the example uses 192.168.1.42. Keep the same separators shown there.
CIDR prefix
A number; the example uses 24. Values must fall between 0 and 32.

A worked example

With the values this page opens on — IPv4 address 192.168.1.42, CIDR prefix 24 — the answer is 192.168.1.0/24. The supporting detail reads: Mask: 255.255.255.0 · Broadcast: 192.168.1.255 · Usable hosts: 254 · Range: 192.168.1.1–192.168.1.254. Reset restores exactly these numbers.

Reading the result

The headline number is IPv4 subnet. Change any field and the figure, along with the graph beside it, is recomputed from the values you typed — nothing is rounded before the arithmetic runs.

Assumptions and limits

IPv4 only. /31 reports two point-to-point endpoints; /32 reports one host. Other prefixes exclude network and broadcast from usable host count.

Your privacy

Nothing you type leaves your browser.

Related calculators

Password generator ↗ · URL encode / decode ↗ · Base64 encode / decode ↗ · Bandwidth / transfer time ↗