IP Subnet / CIDR Calculator

Calculate network address, broadcast, first/last usable host, subnet mask, wildcard mask, and host count from any CIDR notation (e.g. 192.168.1.0/24). Includes binary view. Free, instant, no login.

Did we solve your problem today?

What Is a CIDR / Subnet Calculator?

A CIDR calculator (also called a subnet calculator or IP subnet calculator) takes an IP address and prefix length — such as 192.168.1.0/24 — and instantly computes every property of that network: the network address, broadcast address, first and last usable host, total host count, subnet mask, and wildcard mask. This tool also shows the binary representation of each address so you can see exactly which bits belong to the network portion and which are available for hosts.

Network administrators, DevOps engineers, cloud architects, and students use subnet calculators daily to plan IP address spaces, configure routers and firewalls, and troubleshoot connectivity problems. Doing the bit-math manually for even a /22 or /19 is error-prone; a calculator eliminates the guesswork.

How to Use This Tool

Enter an IP address and prefix length in CIDR notation — for example 10.0.0.0/8 or 192.168.100.50/28 — and the results appear instantly as you type. You can enter a host address (like 192.168.1.5/24) and the tool will automatically derive the correct network address by zeroing the host bits.

Each result field has a Copy button so you can paste individual values — the network address, subnet mask, or wildcard mask — directly into a router config, firewall rule, or Terraform variable.

Understanding the Output

FieldDescription
Network AddressFirst address of the subnet; identifies the network. Not assignable to a host.
Broadcast AddressLast address; packets here reach all hosts on the subnet. Not assignable to a host.
First Usable HostNetwork address + 1. The lowest IP you can assign to a device.
Last Usable HostBroadcast address − 1. The highest assignable IP.
Usable HostsTotal addresses minus 2 (network + broadcast).
Subnet MaskDotted-decimal form of the prefix (e.g. 255.255.255.0 for /24).
Wildcard MaskBitwise inverse of the subnet mask; used in ACLs and OSPF.

Common Subnet Reference

CIDRSubnet MaskUsable HostsTypical Use
/30255.255.255.2522Point-to-point links
/29255.255.255.2486Small office LAN
/28255.255.255.24014VLAN segment
/27255.255.255.22430Small subnet
/24255.255.255.0254Standard LAN
/22255.255.252.01022Medium network
/20255.255.240.04094Large campus
/16255.255.0.065 534Large organization
/8255.0.0.016 777 214ISP / backbone

Special Prefix Lengths

/32 (host route): A single host. Network address, broadcast, first host, and last host are all the same IP. Used in routing tables to advertise a specific host, and in firewall rules to match exactly one IP.

/31 (point-to-point, RFC 3021): Two addresses, both usable as host IPs — no separate network/broadcast. Used for router-to-router links where every address matters.

/0 (default route): Matches all IPv4 addresses. Used as the “catch-all” route (0.0.0.0/0) in routing tables to forward unmatched traffic to a default gateway.

Binary View Explained

The binary display shows each octet as 8 bits, separated by dots. For 192.168.1.0/24:

IP:   11000000.10101000.00000001.00000000
Mask: 11111111.11111111.11111111.00000000
      |←── network bits (24) ──→|←hosts→|

The 1-bits in the mask mark the network portion; the 0-bits mark the host portion. Anything that falls outside the network bits can vary between .0 (network) and .255 (broadcast) for a /24.

Private IP Ranges (RFC 1918)

These ranges are reserved for private networks and are not routable on the public internet:

Cloud providers and home routers carve subnets out of these ranges. Use this calculator to determine which sub-range to allocate to each VPC, VLAN, or office location.

FAQ

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation expresses an IP address and its network prefix length in one compact form, such as 192.168.1.0/24. The number after the slash is the prefix length — the count of consecutive 1-bits in the subnet mask. /24 means the first 24 bits are the network portion, leaving 8 bits for host addresses.

How many usable hosts does a /24 subnet have?

A /24 subnet has 256 total addresses (2^8) but 2 are reserved: the network address (.0) and the broadcast address (.255). That leaves 254 usable host addresses. The general formula for usable hosts is 2^(32 - prefix) − 2 for prefixes /1 through /30.

What is the difference between subnet mask and wildcard mask?

A subnet mask has 1-bits for the network portion and 0-bits for the host portion (e.g. 255.255.255.0 for /24). A wildcard mask is the bitwise inverse — 0-bits for network and 1-bits for host (e.g. 0.0.0.255 for /24). Wildcard masks are used in Cisco ACLs and OSPF configuration to specify which bits must match.

What is the network address vs. the broadcast address?

The network address is the first address in a subnet — all host bits set to 0. It identifies the subnet itself and cannot be assigned to a host. The broadcast address is the last address — all host bits set to 1. Packets sent to the broadcast address are delivered to all hosts on the subnet. Neither is usable as a host address.

Can I enter a host IP instead of the network address?

Yes. If you enter a host address like 192.168.1.5/24, the calculator automatically zeroes the host bits to derive the correct network address (192.168.1.0/24). The original IP is still shown as "Input IP" so you can verify the calculation.