IP CIDR Calculator

Calculate subnet mask, network address, broadcast address, first/last host, and usable host count from any IPv4 CIDR notation.

IP Address192.168.1.0
Subnet Mask255.255.255.0
Network Address192.168.1.0
Broadcast Address192.168.1.255
First Host192.168.1.1
Last Host192.168.1.254
Total Hosts256
Usable Hosts254
IP ClassC
Private RangeYes

When an IP CIDR calculator is the right tool

Use this page to unpack a single IPv4 prefix: mask, network, broadcast, host range, and how many addresses it contains. Type a CIDR or click a preset; the table updates as you type. It is an IPv4 calculator only — there is no IPv6 mode, and nothing is uploaded.

To look up a public address on the internet, use IP Lookup instead. That tool calls a third-party API; this one does not leave your browser.

Use cases

Checking a private LAN prefix

The default value is 192.168.1.0/24, and presets cover 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and 10.10.0.0/22. You can also type a host address such as 192.168.1.5/24 — the IP Address row keeps what you typed, while Network and Broadcast are derived from the prefix.

Point-to-point links and single addresses

A /31 shows two usable addresses (first and last equal the network and “broadcast” values). A /32 is a single address, with total and usable both 1. That matches common router practice and differs from subtracting two addresses as a /24 does.

Reading class and private flags with care

The class letter is historical and comes from the first bits of the input address. 127.0.0.1/8 is class A but Private Range is No, because loopback is not in RFC 1918. 0.0.0.0/0 reports 4,294,967,296 total addresses and is also not private.

How the calculation works

The input is trimmed and split on the first slash. The prefix must parse as an integer from 0 through 32, and the address must have four decimal octets in 0–255. A 32-bit mask is built from the prefix (with /0 special-cased to 0.0.0.0), then network and broadcast are computed with bitwise AND and OR. Counts use 2^(32 − prefix). Total and usable values are shown with the browser’s locale grouping separators.

Example — the default /24
192.168.1.0/24

Subnet mask     255.255.255.0
Network         192.168.1.0
Broadcast       192.168.1.255
First host      192.168.1.1
Last host       192.168.1.254
Total hosts     256
Usable hosts    254
IP class        C
Private range   Yes

Those figures are the usual /24 numbers: 256 addresses, 254 usable, class C, and private because 192.168.1.0 sits in 192.168.0.0/16.

What this tool does not do

It does not handle IPv6, supernet summarization, or splitting one prefix into smaller ones. It does not treat CGNAT, loopback, or link-local as private. It does not contact a registry. For a conversion of a single address into other notations, see IP Converter.

How to use the CIDR Calculator

  1. Type an IPv4 CIDR in the form x.x.x.x/n, or click a preset.
  2. Read the table as it updates. An invalid value shows an error instead of results.
  3. Change the prefix or the host address to compare ranges without leaving the page.

Frequently asked questions

What does this calculator show?

From an IPv4 CIDR such as 192.168.1.0/24 it shows the subnet mask, network address, broadcast address, first and last host, total and usable address counts, a classful A/B/C or D/E label, and whether the address you typed falls in RFC 1918 private space. The table updates as you type. Five presets fill common private ranges.

How many usable hosts does a /24, /31, or /32 have?

For prefixes 0–30, usable hosts are total minus 2 (network and broadcast). A /24 therefore has 256 total addresses and 254 usable. For /31 and /32 the tool follows the point-to-point convention: every address is usable, so a /31 has 2 usable addresses and a /32 has 1. First and last host are the network and broadcast values in those two cases.

Does “Private Range” cover every special-use network?

No. Yes is shown only when the input address itself is in 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16. Loopback (127.0.0.0/8), link-local (169.254.0.0/16), and shared address space (100.64.0.0/10) are reported as No. The check uses the address you typed, not whether the whole prefix stays inside a private block.

How is the IP class determined?

It is the historical class of the input address, not of the network prefix: A for 0–127, B for 128–191, C for 192–223, and D/E for 224–255. A /12 such as 172.16.0.0/12 is still labeled B. Classful naming is shown for reference; the calculations themselves are classless.

Does this tool support IPv6 or other formats?

No. It accepts IPv4 dotted-quad addresses with a prefix from 0 to 32. A missing slash, a prefix outside that range, or an octet outside 0–255 is rejected. parseInt is used for the prefix, so a value such as 192.168.1.0/24foo is still treated as /24. There is no IPv6 path, no wildcard mask, and no split into multiple subnets.

Is my input sent to a server?

No. The arithmetic runs in your browser as you type. Closing the tab discards what you entered.

Related tools and guides

References

  • RFC 4632 describes classless IPv4 prefixes. This page applies that model to a single IPv4 CIDR you type.
  • RFC 3021 allows both addresses in a /31 to be used on a point-to-point link, which is why this calculator does not reserve network and broadcast addresses for /31 or /32.
  • RFC 1918 defines the three private IPv4 blocks that the Private Range row recognizes.