Calculate CIDR

Calculate network boundaries, host counts, and masks from a CIDR prefix.

freeworks offlinenothing uploaded
ToolCIDR Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Address and prefix become fixed-width bits; the mask yields network and broadcast boundaries, host count, wildcard mask, and range. IPv4 and IPv6 use separate widths and special-address rules.

  • Prefix length expresses routing boundaries compactly.
  • Host counts follow the selected address family.

Worked example

Calculate a /24 private subnet
Get network, broadcast, mask, and range for 192.168.1.0/24
Input
											192.168.1.0/24
										
Output
												CIDR: 192.168.1.0/24
Network address: 192.168.1.0
Broadcast address: 192.168.1.255
First IP: 192.168.1.0
Last IP: 192.168.1.255
Total addresses: 256
Subnet mask: 255.255.255.0
Wildcard mask: 0.0.0.255
											

When to use this

Routers, firewalls, and IPAM systems calculate CIDR blocks.

Edge cases

  • A host-bit input is normalized to its network.
  • /31 and /32 have special IPv4 semantics.
  • IPv6 has no broadcast and needs different host rules.

References