NETCUE TECHNOLOGY: Your IT, Simplified.

CIDR Calculator (CIDR to Subnet Mask)

Convert CIDR prefix length to subnet mask (and back). Get network bits and host bits instantly for IPv4 subnetting.

CIDR Calculator for IPv4 Subnet Mask Conversion

A CIDR calculator is the fastest way to convert between CIDR prefix length and a dotted-decimal subnet mask. Networking teams use CIDR daily for subnet design, routing summaries, firewall objects, VLAN planning, and cloud VPC CIDR blocks. This page focuses on practical subnetting: enter “/24”, “24”, or “255.255.255.0” and the calculator returns the equivalent format plus the number of network bits and host bits.

CIDR (Classless Inter‑Domain Routing) replaced classful addressing to make IP allocation flexible and efficient. Instead of relying on fixed Class A, B, or C boundaries, CIDR lets you choose the exact prefix length you need. That means you can design networks that match real host requirements, avoid wasting address space, and keep routing tables smaller through aggregation.

For IT operations, conversions are a common pain point. A quick CIDR to subnet mask converter reduces errors when creating VLANs, static routes, ACL entries, or IPAM documentation. If you work across multiple sites, hospitality networks, staff accommodation networks, or cloud deployments, consistent CIDR notation makes collaboration easier and prevents overlapping address plans.

How to Use

  1. Enter a CIDR prefix (for example, /24 or 24) or a subnet mask (for example, 255.255.255.0).
  2. Click Convert to generate the equivalent values.
  3. Review network bits and host bits to validate the subnet size.
  4. Use Copy to copy the output into your documentation.

What Is CIDR?

CIDR is a notation that describes how many bits belong to the network portion of an IPv4 address. IPv4 addresses are 32 bits long. If the prefix is /24, that means 24 bits define the network and 8 bits define hosts. Subnet masks represent the same boundary in dotted format. The mask for /24 is 255.255.255.0 because the first 24 bits are set to 1 and the remaining 8 are 0.

Understanding the relationship between prefix length and subnet mask helps you estimate capacity. Host bits determine the number of addresses: 2^(host bits). A /26 has 6 host bits, so it contains 64 total addresses. Most LAN subnets reserve the first (network) and last (broadcast) address, leaving 62 usable. CIDR also helps with route summarization, where multiple subnets can be represented by a single aggregated prefix.

Common CIDR Examples

These conversions are frequently used in real networks. Use them when reviewing configurations, translating legacy subnet masks, or sizing VLANs quickly:

  • /8 = 255.0.0.0
  • /16 = 255.255.0.0
  • /20 = 255.255.240.0
  • /22 = 255.255.252.0
  • /24 = 255.255.255.0
  • /27 = 255.255.255.224
  • /30 = 255.255.255.252

A practical tip for subnetting: if you are building multiple segments, choose a summary prefix that can be advertised upstream and keep allocations inside it. This reduces route table size and makes firewall policy objects consistent. In cloud environments, this also simplifies VPC peering and reduces the risk of overlapping networks.

Use Cases

  • Convert a subnet mask from a legacy network diagram to CIDR for cloud VPC configuration.
  • Confirm subnet size before creating DHCP pools and reserved ranges.
  • Validate ACL and firewall objects by ensuring the correct prefix length.
  • Document VLANs and routing in a consistent CIDR-friendly format.
  • Support VLSM planning by choosing a prefix that matches host needs.

Related Tools

FAQ

What does /24 mean in CIDR?

/24 means 24 network bits and 8 host bits in an IPv4 address. It corresponds to the subnet mask 255.255.255.0.

Can I input 24 without the slash?

Yes. The calculator accepts “24” and treats it as “/24”.

Why is CIDR preferred over classful addressing?

CIDR supports flexible subnet sizes, reduces wasted addresses, and improves routing scalability through aggregation.

How do I convert a subnet mask to CIDR?

A valid subnet mask has contiguous 1 bits from the left. Count those bits to get the prefix length, such as 255.255.255.0 = /24.

Does CIDR apply to IPv6?

Yes. IPv6 also uses prefix lengths, but subnetting conventions differ (for example, /64 for LANs).