CIDR Calculator

Calculate IPv4 network address, broadcast address, subnet mask, usable range, and host count from CIDR notation.

859.0K uses Updated · 2026-05-21 Runs locally · zero upload
AD

How to Use CIDR Calculator

Enter an IPv4 address and a prefix length from 0 to 32. The address can be any host address inside the subnet; the calculator applies the prefix mask to find the network address, broadcast address, subnet mask, usable host range, and host count. Prefixes /31 and /32 are shown with no ordinary usable host range.

Formula & Theory - CIDR Calculator

CIDR notation stores the subnet size as a prefix length. The calculator turns that prefix into a 32-bit mask, uses a bitwise AND to clear host bits for the network address, and uses the inverse mask to set host bits for the broadcast address. Host count is based on the remaining host bits, minus the network and broadcast addresses for normal subnets.

mask = 0xffffffff << (32 - prefix)
network = ip & mask
broadcast = network | ~mask
hosts = 2^(32 - prefix) - 2

Use Cases for CIDR Calculator

Use it for subnet planning, router and firewall configuration, lab networks, DHCP range checks, cloud VPC notes, and explaining which addresses belong to a given IPv4 block. It is a quick way to verify a CIDR range before copying it into documentation or configuration.

Frequently asked questions about CIDR Calculator

How do I use CIDR Calculator?

Enter an IPv4 address and CIDR prefix length. The calculator returns network, broadcast, subnet mask, usable range, and host count.

What formula or rule does CIDR Calculator use?

It builds a 32-bit mask from the prefix, computes network = ip & mask, and computes broadcast = network | ~mask.

Is my data stored?

No. All calculations happen in your browser; nothing is sent to a server.