IP Subnet / CIDR Calculator

Type an IPv4 address and a CIDR prefix. 192.168.1.42/24 gives 254. 10.0.0.1/16 gives 65534. 172.16.0.1/30 gives 2. Address math, not a live network.

IPv4 address math, not a live network and not traceroute. A DHCP pool sits on DHCP range.

Input data

You can enter any host IP inside the subnet, not only the network address. CIDR prefix: 0–32.

Results

Enter an IPv4 address and CIDR prefix, then click Calculate.

What this calculator does

From an IPv4 address and CIDR prefix, the tool derives the canonical network block, subnet mask, wildcard, broadcast, host range, and address counts. Enter any host inside the subnet, or paste IP/prefix — you do not need the network address up front.

What CIDR means

CIDR notation (for example /24) states how many bits belong to the network portion. The rest are host bits. A /24 prefix → mask 255.255.255.0 and 256 addresses in the block. Larger prefix numbers mean smaller subnets.

How to read the results

  • Network address — identifies the whole block (first address).
  • Broadcast — last address of the block; used for broadcast traffic on a classic LAN.
  • Subnet mask — dotted form of the prefix; wildcard is its bitwise inverse (ACLs).
  • Host range — addresses typically assigned to devices (except /31 and /32 special cases).
  • Total vs usable — on a classic LAN, usable = total − 2 (network and broadcast).

CIDR quick reference table

A fast lookup of common subnet sizes — without recalculating from scratch.

PrefixMaskTotalUsableTypical use
/8255.0.0.016,777,21616,777,214very large nets / private 10/8
/12255.240.0.01,048,5761,048,574private 172.16/12
/16255.255.0.065,53665,534large VPC / campus
/20255.255.240.04,0964,094medium VPC / VLAN
/24255.255.255.0256254typical LAN / VLAN
/26255.255.255.1926462small VLAN / segments
/27255.255.255.2243230small host groups
/28255.255.255.2401614small pools / lab
/29255.255.255.24886small links / DMZ
/30255.255.255.25242point-to-point links
/31255.255.255.25422*P2P (RFC 3021)
/32255.255.255.25511*single host / route

* /31 and /32 use different semantics than a classic LAN — see calculator results and FAQ.

Private IPv4 ranges (RFC 1918)

  • 10.0.0.0/8 — 10.0.0.0 – 10.255.255.255
  • 172.16.0.0/12 — 172.16.0.0 – 172.31.255.255
  • 192.168.0.0/16 — 192.168.0.0 – 192.168.255.255

These ranges are for LANs, offices, and internal cloud networks. They are not routed on the public Internet. The calculator marks a result as private when the network falls in RFC 1918.

Use cases

  • LAN / VLAN planning
  • VPC subnet sizing
  • firewall rules and CIDR allowlists
  • ACL planning with wildcard masks
  • Kubernetes / cluster networking basics
  • documentation and range troubleshooting

How it works

The IP Subnet / CIDR Calculator in this calculator counts usable hosts from the prefix. 192.168.1.42 and /24 give 254. 10.0.0.1/16 and /16 give 65534. 172.16.0.1 and /30 give 2. The formula is 2^(32−p) minus 2, except /31 and /32. This is not a live network.

Field ip-addr is the address. Field ip-cidr is the prefix. 254 is 256 minus 2. 65534 is 65536 minus 2. 2 is 4 minus 2. The address may carry /16 in the text. The calculator does not query a router.

254 is not a DHCP lease. 65534 does not come from ipconfig. 2 at /30 is two point-to-point hosts. Another prefix at the same address changes the hosts. There is no interface probe.

DHCP range next door starts a pool after reserved hosts. IPv6 shorthand compresses hextets. Here 192.168.1.42/24 stays 254, a CIDR sketch from two fields.

Type 192.168.1.42 and 24, then Calculate. The result is 254. 10.0.0.1/16 needs prefix 16. A blank address is a field error. This is not a network scan.

192.168.1.42/24 gives 254. 10.0.0.1/16 gives 65534. 172.16.0.1/30 gives 2. Another CIDR at the same IP changes the hosts.

Formula

usable hosts = 2^(32 − prefix) − 2, except /31 and /32. Address math, not a live network.

How to use

  1. Type address 192.168.1.42 and prefix 24.
  2. Click Calculate. Usable hosts are 254.
  3. 10.0.0.1/16 and 16 give 65534. 172.16.0.1 and 30 give 2.
  4. Address math, not a live network.
  5. A DHCP pool after reserve sits on DHCP range.

192.168.1.42/24 gives 254

Usable hosts from the prefix. 192.168.1.42/24 gives 254. Address math, not a live network.

Subnet
IPv4 from two fields. 192.168.1.42/24 leaves 254 hosts. Not a router.
CIDR
The ip-cidr prefix. /16 gives 65534. /30 gives 2. Not a live network.
hosts
The calculator result. 254 at /24. 2 at /30. Classic minus 2.

Examples

Example 1

  • 192.168.1.42
  • CIDR 24

254

How many hosts at 192.168.1.42/24? 254. Address math, not a live network.

Example 2

  • 10.0.0.1/16
  • CIDR 16

65 534

What about 10.0.0.1/16? 65534. 2^16 minus 2.

Example 3

  • 172.16.0.1
  • CIDR 30

2

What about 172.16.0.1/30? 2. Two hosts on the link.

Related calculators

Common questions

How many hosts at 192.168.1.42/24?

254. 2^8 minus 2. Address math, not a live network.

What about 10.0.0.1/16?

65534. 2^16 minus 2. Prefix 16 in the CIDR field.

What about 172.16.0.1/30?

2. Four addresses, minus network and broadcast.

Is this a live network?

No. The calculator does not query an interface and does not traceroute. Two fields only.

What about /31 and /32?

They are special cases. Classic minus 2 does not apply the same way as /24.

Is 10.0.0.1/16 in the address enough?

You still type the prefix in ip-cidr. The example keeps 16 in both.

Is 254 a DHCP pool?

No. DHCP sits on the neighbour card. Here hosts from the mask.

Where do I compress IPv6?

On IPv6 shorthand. Here IPv4 CIDR stays.

Does a blank address count?

No. Address and prefix must be valid. This is not a scan.

Knowledge sources

The calculator counts bits, bytes or throughput from your numbers. Below are SI and bit definitions (NIST).

Page updated in 2026.