Skip to main content

CIDR Calculator

Convert CIDR notation into subnet mask, network and broadcast addresses, host range, and usable host count for every prefix length from /0 to /32. Handles classful IP identification and displays binary representations for each calculated value.

Runs entirely in your browser

This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.

Networking
IP Addressing
Subnetting
Loading the tool
Reference

Documentation

CIDR notation compresses an IP address and a subnet mask into one string, such as 192.168.1.0/24, where the number after the slash is the prefix length: how many leading bits of the address define the network. An address entered with or without that suffix computes the full subnet breakdown, with the prefix length selectable separately from /0 to /32 when the address alone does not include one.

Results give the network address, broadcast address, subnet mask, wildcard mask, first and last usable hosts, total addresses, and usable host count for the chosen prefix length.

192.168.1.0/26 leaves 32 - 26 = 6 host bits, for 2^6 = 64 total addresses; the standard subtraction of the network and broadcast addresses leaves 64 - 2 = 62 usable hosts. The network address is 192.168.1.0, the broadcast address is 192.168.1.63, and the usable range runs from 192.168.1.1 to 192.168.1.62.

Three prefix lengths take special treatment, since the general 2^(32 - prefix) - 2 rule breaks down at the extremes. A /32 describes a single host and has no broadcast address. A /31 defines a point-to-point link with exactly two usable addresses and no broadcast. A /0 covers the entire IPv4 address space.

Settings adds binary representations, each address shown as a 32-bit binary string grouped into octets, and a step-by-step view of the bitwise AND operation that derives the network address from the input IP and the subnet mask.

Subnet calculations appear in network planning, security auditing, cloud infrastructure provisioning, and education. The following scenarios illustrate where a CIDR calculator fits into common workflows.

  • Network Design: an allocated address block of 172.16.0.0/20 gives 4094 usable host addresses, a broadcast boundary, and the wildcard mask needed for access control lists on a corporate LAN.
  • Cloud Infrastructure: a VPC subnet on AWS, Azure, or GCP sized against different prefix lengths shows the trade-off directly: a /24 provides 254 usable addresses, a /21 yields 2046.
  • Firewall Rules: a proposed CIDR block, checked against its first and last usable host, either covers exactly the intended range or spills outside the intended scope.
  • Education: binary representations and step-by-step calculations show how the bitwise AND between an IP address and a subnet mask produces the network address, and how prefix length and available host count trade off against each other.
  • Troubleshooting: two devices sharing a subnet share the same network address once each is checked against the configured prefix length.
  • Documentation: precise subnet details, including the full host range, broadcast address, and wildcard mask, generate for network records without manual binary math; binary representations add the 32-bit notation for low-level reference material.
  • Security Auditing: a publicly exposed CIDR range checked against its total address count and boundary addresses confirms it matches the intended allocation and no more.
Inputs, outputs, and what the CIDR Calculator computes

What the CIDR Calculator asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

Inputs

  • IP Address / CIDR Notation (text input)
  • Prefix Length
  • Show binary representations · default: off
  • Show step-by-step calculation · default: off

Controls

Calculate · Reset

Example

192.168.1.0/26 leaves 32 - 26 = 6 host bits, for 2^6 = 64 total addresses; the standard subtraction of the network and broadcast addresses leaves 64 - 2 = 62 usable hosts.