CIDR Subnet Calculator

Get network, broadcast, usable host range, netmask and wildcard from any IPv4 address and CIDR prefix — in your browser.

How to use

  1. Type an IPv4 address — pasting the full CIDR form such as 192.168.1.10/24 also works and fills the prefix for you.
  2. Adjust the prefix (0–32) and watch the whole subnet recalculate instantly.
  3. Read the network and broadcast addresses, the first and last usable hosts, the host count, the subnet mask and the wildcard mask — and copy the network in one click.

About this tool

CIDR (Classless Inter-Domain Routing) is how IPv4 networks have been described since 1993: an address followed by a slash and a prefix length, like 192.168.1.10/24. The prefix says how many of the 32 bits identify the network; the remaining bits identify hosts inside it. From that single piece of information this calculator derives everything a network plan needs — the network address, the broadcast address, the range of usable hosts, the subnet mask in dotted-decimal form and its inverse, the wildcard mask.

Under the hood the tool converts the address to a 32-bit unsigned integer and applies the same bitwise operations a router applies: the network address is the IP AND the mask, the wildcard is the inverted mask, and the broadcast is the network OR the wildcard. For prefixes up to /30, two addresses in every subnet are reserved — the network itself and the broadcast — so the usable host count is 2 to the power of (32 minus prefix), minus 2. The edge cases are handled correctly too: a /31 is a point-to-point link where both addresses are usable (RFC 3021), and a /32 pins down a single host.

This is the calculation behind everyday networking tasks: splitting an office network into VLANs, sizing a DHCP pool, writing firewall rules, or building Cisco-style access lists — which is exactly what the wildcard mask output is for. It is also a solid study companion for CCNA-style certification questions, since the explanation shows the intermediate values instead of just the answer, plus a quick reference of common prefixes from /8 to /30. All of the arithmetic runs 100% in your browser; no address you type is looked up, logged or transmitted.

The formula

Network = IP AND mask; wildcard = NOT mask; broadcast = network OR wildcard; usable hosts = 2^(32 − prefix) − 2 for prefixes up to /30. Example: 192.168.1.10/24 → network 192.168.1.0, broadcast 192.168.1.255, 254 usable hosts.

Frequently asked questions

How many usable hosts does a /24 have?

254. A /24 spans 256 addresses, but the first one (the network address) and the last one (the broadcast address) are reserved, leaving 254 for devices — for 192.168.1.0/24 that is 192.168.1.1 through 192.168.1.254.

Why are two addresses subtracted from every subnet?

Because the all-zeros host part identifies the network itself and the all-ones host part is the broadcast address that reaches every device in the subnet. Neither can be assigned to a machine, except in the special /31 and /32 cases.

What is the wildcard mask used for?

It is the bit-inverted subnet mask, used mainly in Cisco access control lists and OSPF configuration: a 0 bit means "must match" and a 1 bit means "ignore". For a /24, mask 255.255.255.0 becomes wildcard 0.0.0.255.

Does the calculator support /31 and /32?

Yes. A /31 is treated as a point-to-point link with 2 usable addresses, as defined by RFC 3021, and a /32 is reported as a single-host route. Both are common in router configurations.

Does the IP address I type leave my browser?

No. All the bitwise arithmetic runs in JavaScript on your device. The address is not looked up, logged or sent anywhere.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.