🎭

Subnet Mask Converter

Auto-convert between CIDR prefix, dotted mask, wildcard mask and host count.
Subnet Mask 📂 Network 👤 ToolWorld 🏷️ v1.1.12
Loading...

Subnet Mask Converter

Prefix ↔ Dotted mask ↔ Wildcard ↔ Usable hosts

Try /24, 24, 255.255.255.0, 0.0.0.255, or a host count like 500

How to Use

📖 Tool Introduction


In networking and day-to-day operations work, a subnet mask is written in four common ways: as a CIDR prefix such as /24, as a dotted-decimal mask such as 255.255.255.0, as a wildcard inverse mask such as 0.0.0.255 (frequently seen in Cisco ACLs and OSPF configurations), and finally as the number of usable host addresses the mask supports. Beginners often need to jump back and forth between these notations, routinely confuse the inverse wildcard with the real mask, and struggle to reverse-engineer the best prefix from a required host count. The Subnet Mask Converter exists precisely to remove that friction: you type any one of the four notations into the single input box, the tool automatically detects which kind it is, and then derives the other three equivalents using 32-bit integer bitwise operations. For example, entering 255.255.255.192 immediately tells you that this equals /26, that the wildcard is 0.0.0.63, and that 62 hosts are usable. Conversely, if you type a required host count such as 500, the tool works backwards and returns the smallest prefix, /23, that can hold them. Every calculation runs locally in the browser, so nothing is uploaded and no network request is ever made. The output is laid out as four quadrant cards, and each card can be clicked independently to copy its own value, which is convenient when you need to paste the CIDR notation into one config file and the wildcard mask into another.

✨ Key Features


  • Four-way auto-detection: type /24, 24, 255.255.255.0, 0.0.0.255 or a host count and the tool identifies the type for you
  • Exact bitwise maths: a valid mask must have contiguous high-order 1 bits, and non-contiguous masks are rejected with a friendly message
  • Four equivalents at once: CIDR prefix, dotted mask, wildcard inverse mask and usable host count with total address count
  • Reverse host-count lookup: enter how many usable hosts you need (for example 500) and get the smallest prefix that fits
  • Click-to-copy quadrants: each result card is independent, so you can copy exactly the value you need
  • Fully offline: no network request is made, so the tool is safe to use even when inspecting internal ranges

📝 How to Use


  1. Type any mask notation you already know into the input, for example 255.255.255.0
  2. You may also type /24, the bare number 24, a wildcard 0.0.0.255, or a required host count such as 500
  3. Click the Convert button; a badge shows the detected input type at the top
  4. The four quadrant cards display the CIDR prefix, dotted mask, wildcard mask and usable host count
  5. Click any card to copy that single value, or use Copy result to grab all four lines at once

⚠️ Notes


  • Contiguous masks only: a legal subnet mask must have contiguous 1 bits on the high side; a broken mask like 255.0.255.0 cannot be converted and the tool will tell you so
  • Wildcard direction: the wildcard mask is the bitwise inverse of the dotted mask, so 255.255.255.0 pairs with 0.0.0.255; never mix the two up
  • Host boundaries: /31 is treated as two usable addresses per RFC3021 and /32 as one host address; for all other prefixes usable hosts equal total minus two
  • Very large counts: if the required host count exceeds one network segment, the tool falls back to /0 and warns you
  • Mask only: this tool converts the mask itself and does not parse a concrete IP; use the IP Subnet Calculator when you need an actual range

Related

⏫︎