CIDR Calculator

Convert an IPv4 CIDR prefix into subnet mask, wildcard mask, total addresses, and usable hosts.

Save

Inputs

/

Your values stay on this device.

Results

Total Addresses
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Traditional Usable Hosts254

Report

Export and share

Document

Copy and share

Assumptions

  • This calculator covers IPv4 prefix math only.
  • Usable hosts use the traditional network/broadcast subtraction model.
  • Results are calculated locally in your browser.

Sensitivity preview

CIDR Prefix Current: Total Addresses 256

Formula: Total addresses = 2^(32 - CIDR prefix). Subnet mask has prefix-length leading 1 bits. Usable hosts = max(total addresses - 2, 0).

Related Tools

View All

About this CIDR Calculator

CIDR notation expresses an IPv4 subnet mask as the number of leading network bits. This calculator converts the prefix into the common values engineers need when planning networks.

Who this calculator is for

  • Network engineers and sysadmins planning IPv4 ranges.
  • Students learning CIDR and subnet masks.
  • Cloud and firewall administrators checking host capacity.

When to use it

  • Convert /24, /20, or /30 prefixes into subnet masks.
  • Estimate host capacity before assigning a network block.
  • Get wildcard masks for firewall or ACL planning.

How to use this calculator

  1. Enter a CIDR prefix length from 0 to 32.
  2. Review the subnet mask, wildcard mask, total addresses, and usable host count.
  3. Use the IP Subnet Calculator if you also need network and broadcast addresses for a specific IP.

Key assumptions

  • This calculator covers IPv4 prefix math only.
  • Usable hosts use the traditional network/broadcast subtraction model.
  • Results are calculated locally in your browser.

Accuracy and testing

Review formula sources, default test cases, assumptions, unit handling, rounding rules, and changelog for this calculator.

View accuracy page

How this calculator works

Subnet mask is the prefix-length number of leading 1 bits. Total addresses = 2^(32 - prefix). Traditional usable hosts = total addresses - 2, with /31 and /32 shown as 0 traditional hosts.
Total addresses = 2^(32 - CIDR prefix). Subnet mask has prefix-length leading 1 bits. Usable hosts = max(total addresses - 2, 0).

Inputs explained

CIDR prefix

The number after the slash in CIDR notation, such as 24 in 192.168.1.0/24.

Understanding your results

Total addresses includes network and broadcast addresses. Traditional usable hosts subtracts those two reserved addresses.

Example scenarios

/24 network

/24 converts to 255.255.255.0 with 256 total addresses and 254 traditional usable hosts.

Key Features

  • Instant Calculation
  • Private & Secure
  • Mobile Optimized

Tips & Best Practices

  • Use /30 for traditional point-to-point links with 2 usable hosts.
  • Modern /31 point-to-point behavior may differ from traditional host-count math.
  • Use the IP Subnet Calculator to calculate a specific network range from an address.

Frequently Asked Questions

What does /24 mean?
/24 means the first 24 bits are network bits. The subnet mask is 255.255.255.0.
Why are usable hosts lower than total addresses?
Traditional IPv4 subnetting reserves the first address as the network address and the last as the broadcast address.
Does this support IPv6?
No. This calculator is for IPv4 CIDR math.