Networking

IPv4 / CIDR calculator

Calculate IPv4 network, broadcast, subnet mask, wildcard and address ranges from a CIDR prefix or dotted-decimal subnet mask.

Input

IPv4 / CIDR calculator

Example: 192.168.1.10/24, or an address on its own with the field below.

Examples: 24, /24 or 255.255.255.0. Optional when the address includes a prefix; both values must agree.

Load an example

Calculation requires JavaScript in your browser. Documentation remains available; no input is sent to a server.

Results

Enter an address and its prefix or subnet mask to calculate results.

Understanding IPv4 results

Input conventions and privacy

Leading and trailing field whitespace is ignored. Octets with leading zeroes, abbreviated or hexadecimal notation, extra internal characters and non-contiguous masks are rejected. If two prefixes are supplied, they must be equivalent. Calculations remain in your browser without storing addresses or making network requests.

A verifiable example

For 192.168.1.10/24: network 192.168.1.0, broadcast 192.168.1.255, hosts from 192.168.1.1 to 192.168.1.254, giving 256 addresses and 254 theoretical hosts. Example buttons fill the fields; click Calculate to produce results.

Technical references : RFC 3021 · RFC 4632

Frequently asked questions

What does an IPv4 CIDR prefix mean?

In 192.168.1.10/24, the first 24 bits identify the network and the remaining 8 locate an address within the block. A /n prefix defines 2^(32 − n) addresses, so /24 contains 256. The calculation is classless: it does not assume class A, B or C boundaries.

How do a subnet mask and a wildcard mask differ?

A subnet mask has consecutive 1 bits followed by 0 bits: /24 is 255.255.255.0. A wildcard flips every mask bit, giving 0.0.0.255 in this example. The calculator accepts CIDR or a contiguous decimal mask; 255.0.255.0 is rejected.

How are the network, broadcast and host range calculated?

Setting the host bits to 0 gives the network boundary; setting them to 1 gives the upper boundary. For /0 through /30, that upper boundary is the mathematical broadcast, and hosts run from network + 1 to broadcast − 1. You may enter a host IP; it need not be aligned to the network.

How many usable hosts does a subnet provide?

For /0 through /30, two boundary addresses are subtracted from the total: a /26 has 64 addresses and 62 theoretical hosts. Special-purpose ranges are not removed. This capacity does not prove that every address is available or can actually be assigned.

Why are /0, /31 and /32 handled differently?

/0 spans the entire IPv4 space: 4,294,967,296 addresses. On an RFC 3021 point-to-point /31 link, both addresses are usable when the equipment supports it. /32 represents a single address or host route. No distinct broadcast is shown for /31 or /32; subtracting two addresses would be incorrect.

Back to tools home