IT & Tech

CIDR to Subnet Mask Converter

Convert CIDR prefixes like /24, /27, or /30 into subnet masks and host counts for everyday IPv4 network planning.

Updated May 2026No signup requiredBuilt for mobile

Subnet mask--

Total addresses--

Usable hosts--

Formula or method

CIDR prefix = number of network bits.

Host bits = 32 - prefix.

Total addresses = 2 raised to host bits.

Worked examples

Common LAN

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

Small subnet

/30 converts to 255.255.255.252 with 4 total addresses and 2 traditional usable hosts.

Practical use cases

  • network documentation
  • VLAN design
  • DHCP planning
  • firewall planning
  • router configuration

Common mistakes

  • Forgetting the slash
  • counting network and broadcast as hosts on ordinary LANs
  • using classful shortcuts
  • not checking overlap
FAQ

CIDR to Subnet Mask Converter questions

How accurate is this calculator?

It is a planning estimate based on the values you enter. Real-world conditions can change the result.

Why do results vary?

Overhead, rounding, equipment limits, supplier units, network conditions, and user behavior can all affect the final number.

Should I round up?

Round conservatively when running short would interrupt a project, backup, stream, trip, or outage plan.

What should I do next?

Use the result card and checklist, then compare related calculators or guides before making a final decision.

Does this replace official documentation?

No. Use manufacturer documentation, platform guidance, or professional advice for critical decisions.